Skip to content

Conversation

@jeromehardaway
Copy link
Contributor

This pull request introduces significant changes to integrate NextAuth for authentication and updates several components to use the new authentication flow. The changes include adding the next-auth package, configuring GitHub as an authentication provider, and modifying the login and profile pages to use NextAuth hooks.

Authentication Integration:

  • package.json: Added next-auth package to the dependencies.
  • src/pages/_app.tsx: Wrapped the application with SessionProvider from next-auth/react and added session handling to the CustomAppProps interface. [1] [2] [3] [4]
  • src/pages/api/auth/[...nextauth].js: Created a new API route for NextAuth configuration, including GitHub as an authentication provider and defining custom callbacks for sign-in, session, and JWT handling. (src/pages/api/auth/[...nextauth].jsR1-R78)

Component Updates:

  • src/pages/login.tsx: Updated the login page to use useSession from next-auth/react for session management and replaced the custom login form with a GitHub sign-in button. [1] [2] [3]
  • src/pages/profile.tsx: Modified the profile page to use useSession from next-auth/react for session management and updated the logout functionality to use signOut from next-auth/react.

Code Simplification:

  • src/components/social-share/layout-01/index.tsx, src/components/social-share/layout-01/social-link.tsx, src/components/ui/social/index.tsx, src/components/ui/social/social-link.tsx: Replaced custom cubic-bezier easing functions with encoded versions for better readability and maintainability. [1] [2] [3] [4]

These changes collectively enhance the authentication flow by integrating GitHub login via NextAuth and simplify the codebase for better readability and maintainability.

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

vercel bot commented Nov 19, 2024

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

Name Status Preview Comments Updated (UTC)
vets-who-code-app ❌ Failed (Inspect) Nov 23, 2024 2:18am

@jeromehardaway jeromehardaway deleted the jeromehardaway/nextAuthLogin branch December 1, 2024 21:34
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