chatbot-template/auth.ts
Jared Palmer e9e40d7a08 Revert "Merge pull request #74 from vercel-labs:jp/next-auth"
This reverts commit 6051e186b5, reversing
changes made to 28f62d80cf.
2023-06-21 14:32:54 -07:00

29 lines
558 B
TypeScript

import NextAuth from 'next-auth'
import GitHub from 'next-auth/providers/github'
export const {
handlers: { GET, POST },
auth,
CSRF_experimental
// @ts-ignore
} = NextAuth({
// @ts-ignore
providers: [GitHub],
callbacks: {
// @ts-ignore
jwt: async ({ token, profile }) => {
if (profile?.id) {
token.id = profile.id
token.image = profile.picture
}
return token
}
// @TODO
// authorized({ request, auth }) {
// return !!auth?.user
// }
},
pages: {
signIn: '/sign-in'
}
})