fix email signin?

This commit is contained in:
Thomas Ruoff
2022-12-26 00:36:54 +01:00
parent 87f2b57b24
commit 42157e8048

View File

@@ -46,7 +46,7 @@ export default async function auth(req: NextApiRequest, res: NextApiResponse) {
async signIn({ account, email }) { async signIn({ account, email }) {
// if user sigin requested magic link via EmailProvider // if user sigin requested magic link via EmailProvider
if (account.provider === 'email') { if (account.provider === 'email') {
if (email.verificationRequest) { if (email?.verificationRequest) {
// only allow admins by email entered // only allow admins by email entered
return account.providerAccountId === ADMIN_EMAIL return account.providerAccountId === ADMIN_EMAIL
} }
@@ -61,4 +61,4 @@ export default async function auth(req: NextApiRequest, res: NextApiResponse) {
}, },
}, },
}) })
} }