From 42157e8048cb2cfdbcfb423030ae0e8d4bf10f0e Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Mon, 26 Dec 2022 00:36:54 +0100 Subject: [PATCH] fix email signin? --- pages/api/auth/[...nextauth].ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/api/auth/[...nextauth].ts b/pages/api/auth/[...nextauth].ts index f82c71f..7d709d6 100644 --- a/pages/api/auth/[...nextauth].ts +++ b/pages/api/auth/[...nextauth].ts @@ -46,7 +46,7 @@ export default async function auth(req: NextApiRequest, res: NextApiResponse) { async signIn({ account, email }) { // if user sigin requested magic link via EmailProvider if (account.provider === 'email') { - if (email.verificationRequest) { + if (email?.verificationRequest) { // only allow admins by email entered return account.providerAccountId === ADMIN_EMAIL } @@ -61,4 +61,4 @@ export default async function auth(req: NextApiRequest, res: NextApiResponse) { }, }, }) -} +} \ No newline at end of file