86b1vx0v2: Add Card and Avatar Components with Conditional Rendering for Login Page#25
86b1vx0v2: Add Card and Avatar Components with Conditional Rendering for Login Page#25Asfik-1999 wants to merge 39 commits into
Conversation
…Logout), and app title/logo.
… on the login page.
| setIsCardVisible(!isCardVisible); | ||
| }; | ||
|
|
||
| const handleLogout = async () => { |
There was a problem hiding this comment.
Don't handle logout here. Remove this logic.
There was a problem hiding this comment.
I've updated the handleLogout function in the ProfileCard component to only make a POST request to the /auth/logout route, as the server-side route in auth/logout/route.ts now handles all the logout logic (clearing cookies and redirecting).
With this change, the client-side code no longer contains any custom logic for handling the logout process—it just calls the route, and everything else is handled server-side.
Is this the correct approach, or would you prefer that I remove the handleLogout function entirely and instead directly navigate to /auth/logout?
There was a problem hiding this comment.
I've removed the logout handling logic from the ProfileCard component as requested. The handleLogout function and its associated code have been removed, and the Logout button no longer performs any action within this component.
| @@ -0,0 +1,37 @@ | |||
| 'use client'; | |||
There was a problem hiding this comment.
Don't query file path name. The common header should only be displayed if the user is authenticated. Use the session object here, and convert this to a server component. @thlurte please provide him guidance if necessary.
| "@radix-ui/react-scroll-area": "^1.1.0", | ||
| "@radix-ui/react-slot": "^1.1.0", | ||
| "@shadcn/ui": "^0.0.4", | ||
| "antd": "^5.20.4", |
| "dotenv": "^16.4.5", | ||
| "dotenv-cli": "^7.4.2", | ||
| "jose": "^5.8.0", | ||
| "lib_test": "file:", |
There was a problem hiding this comment.
What's this? Remove it, if it's unnecessary. Explain here if it's necessary.
There was a problem hiding this comment.
It's not necessary, I will remove that.
Created Card component using ShadCN, including a logout button.
Developed Avatar component with a logo.
Implemented conditional rendering to hide the Card and Avatar components on the login page.