Skip to content

Commit

Permalink
add auth secret
Browse files Browse the repository at this point in the history
  • Loading branch information
odeta939 committed Oct 20, 2023
1 parent c123c88 commit ea2a833
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions vinoa-web/app/api/auth/[...nextauth]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@ const authenticator = NextAuth({
clientSecret: env.GOOGLE_CLIENT_SECRET ?? '',
}),
],
secret: env.NEXTAUTH_SECRET ?? '',
callbacks: {
async jwt({ token, account,}) {
if (account) {
token.idToken = account.id_token
token.expiresAt = account.expires_at
}
async jwt({ token, account }) {
if (account) {
token.idToken = account.id_token;
token.expiresAt = account.expires_at;
}

return token
return token;
},
async session({ session, token }:any) {
session.user.id = token.sub
return session
async session({ session, token }: any) {
session.user.id = token.sub;
return session;
},
},
});
Expand Down

0 comments on commit ea2a833

Please sign in to comment.