Update next-auth

This commit is contained in:
Jared Palmer 2023-06-16 12:03:09 -04:00
parent 187b55aad7
commit fef709a21d
6 changed files with 28 additions and 10 deletions

View file

@ -5,16 +5,23 @@ 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
},
// @ts-ignore
authorized({ request, auth }) {
if (!request.nextUrl.pathname.startsWith('/share/')) return true
return !!auth?.user
}
},
pages: {