fix: remove non-standard fields that would cause prisma validation errors

This commit is contained in:
Ephraim Atta-Duncan
2025-02-06 05:24:50 +00:00
parent ce1c93b2a6
commit 818b1ae520
2 changed files with 24 additions and 1 deletions
+9 -1
View File
@@ -193,7 +193,15 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
idToken: true,
allowDangerousEmailAccountLinking: true,
profile(profile) {
profile(profile, tokens) {
if (tokens && 'refresh_expires_in' in tokens) {
delete tokens.refresh_expires_in;
}
if (tokens && 'not-before-policy' in tokens) {
delete tokens['not-before-policy'];
}
return {
id: profile.sub,
email: profile.email || profile.preferred_username,