Skip to content

Conversation

@jeromehardaway
Copy link
Contributor

This pull request includes updates to the login and profile pages to improve session handling and user experience. The most important changes involve updating the session management logic, improving error handling, and enhancing the user interface during loading states.

Session Management Improvements:

  • src/pages/login.tsx: Added session data to the useSession hook and updated the useEffect hook to handle authenticated states more effectively by using router.replace instead of router.push. Improved error handling during redirection.

  • src/pages/profile.tsx: Replaced the custom user context with the useSession hook from next-auth/react for session management. Updated the useEffect hook to redirect unauthenticated users to the login page and added error handling for redirection issues.

User Interface Enhancements:

  • src/pages/profile.tsx: Enhanced the loading state by displaying a full-screen spinner while the session status is loading or the component is mounting.

Type and Prop Updates:

  • src/pages/profile.tsx: Updated the PageProps and PageWithLayout types to include layout properties and ensure proper typing for the getStaticProps function.

@jeromehardaway jeromehardaway self-assigned this Nov 27, 2024
@vercel
Copy link
Contributor

vercel bot commented Nov 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vets-who-code-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 27, 2024 5:52am

@jeromehardaway jeromehardaway merged commit 070c533 into master Nov 27, 2024
3 checks passed
@jeromehardaway jeromehardaway deleted the RefacterLogin branch November 27, 2024 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants