Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
: Addednext-auth
package to the dependencies.src/pages/_app.tsx
: Wrapped the application withSessionProvider
fromnext-auth/react
and added session handling to theCustomAppProps
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 useuseSession
fromnext-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 useuseSession
fromnext-auth/react
for session management and updated the logout functionality to usesignOut
fromnext-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.