- {platformEntries.length > 0 ? (
- platformEntries.map(([name, url], i) => {
- const Icon = iconMap[name.toLowerCase()] || SiGithub;
-
- // Determine href based on platform
- const href =
- name.toLowerCase() === "leetcode"
- ? leetcodeUrl(url)
- : name.toLowerCase() === "github"
- ? githubUrl(normalizeGitHubURL(url))
- : url;
+ {platformEntries.map(([name, url], i) => {
+ const Icon = iconMap[name.toLowerCase()] || SiGithub;
- return (
-
-
-
-
- {name}
-
-
- Active
-
-
-
- );
- })
- ) : (
-
-
- No platforms linked yet
-
-
- )}
+ return (
+
+
+
+
+ {name}
+
+
+ Active
+
+
+
+ );
+ })}
);
}
\ No newline at end of file
diff --git a/frontend/src/Components/DashBoard/ProfileCard.jsx b/frontend/src/Components/DashBoard/ProfileCard.jsx
index 3b5b509..01cce03 100644
--- a/frontend/src/Components/DashBoard/ProfileCard.jsx
+++ b/frontend/src/Components/DashBoard/ProfileCard.jsx
@@ -25,10 +25,11 @@ const iconMap = {
export default function ProfileCard({ user }) {
if (!user) return null;
-
+
+ // Keep the real user name but ensure consistent UI structure
const socialLinks = user.socialLinks || {};
const entries = Object.entries(socialLinks).filter(
- ([_, url]) => url?.trim() !== ""
+ ([_, url]) => url && typeof url === 'string' && url.trim() !== ""
);
const normalizeLeetcodeURL = (url) => {
@@ -66,7 +67,7 @@ export default function ProfileCard({ user }) {
? user.avatar.startsWith("http")
? user.avatar
: `${import.meta.env.VITE_API_URL}${user.avatar}`
- : `https://api.dicebear.com/6.x/micah/svg?seed=fallback`
+ : `https://api.dicebear.com/6.x/micah/svg?seed=${user.name || 'fallback'}`
}
alt={user.name}
className="w-16 h-16 object-cover rounded-full"
@@ -74,9 +75,9 @@ export default function ProfileCard({ user }) {
{/* Row 1 */}
-
+
{/* Row 2 */}
diff --git a/frontend/src/Components/Features.jsx b/frontend/src/Components/Features.jsx
index 4846db2..62cc785 100644
--- a/frontend/src/Components/Features.jsx
+++ b/frontend/src/Components/Features.jsx
@@ -29,8 +29,8 @@ export function FeaturesSection() {
icon:
,
},
{
- title: "Auto GitHub Sync",
- description: "Sync contributions, commits, and streaks automatically.",
+ title: "GitHub Authentication",
+ description: "Secure login with your GitHub account.",
icon:
,
},
{
diff --git a/frontend/src/Components/GitHubProfile.jsx b/frontend/src/Components/GitHubProfile.jsx
index 727b872..8e1c755 100644
--- a/frontend/src/Components/GitHubProfile.jsx
+++ b/frontend/src/Components/GitHubProfile.jsx
@@ -1,3 +1,4 @@
+
import React, { useEffect, useState } from "react";
import { useParams, Link } from "react-router-dom";
import { Card, CardHeader, CardTitle, CardContent } from "@/Components/ui/Card";
diff --git a/frontend/src/Components/auth/Login.jsx b/frontend/src/Components/auth/Login.jsx
index 6d1182b..e49a1d1 100644
--- a/frontend/src/Components/auth/Login.jsx
+++ b/frontend/src/Components/auth/Login.jsx
@@ -78,6 +78,21 @@ const Login = () => {
window.location.href = `${import.meta.env.VITE_API_URL}/auth/google`;
};
+ const handleGithubLogin = () => {
+ // Clear any existing tokens to avoid conflicts with session-based auth
+ localStorage.removeItem('token');
+ sessionStorage.removeItem('github_token');
+
+ // Log the redirect URL for debugging
+ console.log(`Redirecting to: ${import.meta.env.VITE_API_URL}/auth/github?from=login`);
+
+ // Use a timestamp to prevent caching issues
+ const timestamp = new Date().getTime();
+
+ // Redirect to the GitHub OAuth endpoint
+ window.location.href = `${import.meta.env.VITE_API_URL}/auth/github?from=login&t=${timestamp}`;
+ };
+
// Show verification component if user needs to verify email
if (showVerification) {
return (
@@ -242,6 +257,7 @@ const Login = () => {
{/* Social Login */}