fix replace placeholder L with login link in header - #144
Conversation
|
@kas2804 is attempting to deploy a commit to the Adarsh's projects Team on Vercel. A member of the Team first needs to authorize it. |
MRIARC-08
left a comment
There was a problem hiding this comment.
this issue strictly mentions to add a dynamic login/user-profile-icon if the user has logged in or not, please add a check if use is already logged in and if it has, instead of showing login, show a circular icon which has the first alphabet of user's name .
|
hey i have updated the navigation to be dynamic using useSession.please review the new changes. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| import DV from '../../public/Data visualization.png'; | ||
| import { useRouter } from 'next/navigation'; | ||
| import Link from "next/link"; | ||
| import { SessionProvider, useSession } from 'next-auth/react'; |
There was a problem hiding this comment.
SessionProvider wont work because in this project we use custom jwt auth tokens both for email login and oAuth, so better approach would be to fetch user and then check.
There was a problem hiding this comment.
I removed SessionProvider and useSession. The navigation header now checks the auth state by fetching the user via /api/user/getUser.
|
@kas2804 i have approved it, but there is a slight cleanup needs to be addressed, instead of guessing the api response format with multiple else ifs, just check the correct format and use it. once thats fixed i will merge it . |
|
@MRIARC-08 Thankyou for guiding me 😃.I have opened a new pr for the new changes you had mentioned |
Closes #123
Description
This PR resolves the navigation header bug where an unfinished placeholder
<p>L</p>was visible next to the notification icon on the landing page.Changes Made
<p>L</p>element insrc/app/page.tsx.<Link>component routing to/login.