Created
December 7, 2022 13:33
-
-
Save balazsorban44/6e7f66791afdd0888925c2c2bcf618d8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import NextAuth, { NextAuthOptions } from "next-auth" | |
import GithubProvider from "next-auth/providers/github" | |
export const authOptions: NextAuthOptions = { | |
providers: [ | |
GithubProvider({ | |
clientId: process.env.GITHUB_ID, | |
clientSecret: process.env.GITHUB_SECRET, | |
}), | |
], | |
callbacks: { | |
jwt({ token, profile }) { | |
if (profile) token.id = profile.id | |
return token | |
}, | |
async session({ session, token }) { | |
session.id = token.id | |
return session | |
}, | |
}, | |
} | |
export default NextAuth(authOptions) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment