Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add login to app #634

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

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
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

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.

1 participant