From dce08ea6206fb40ffd538c65e99c20b969c2ec31 Mon Sep 17 00:00:00 2001 From: engin-can <2794116+engin-can@users.noreply.github.com> Date: Tue, 25 Feb 2025 12:33:01 -0800 Subject: [PATCH] Fix "The following fields are invalid: Email, Username" --- src/auth-strategy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/auth-strategy.ts b/src/auth-strategy.ts index 6927f37..ae3e511 100644 --- a/src/auth-strategy.ts +++ b/src/auth-strategy.ts @@ -52,7 +52,7 @@ export const createAuthStrategy = ( let user: User | null = null; if (pluginOptions.useEmailAsIdentity) { - if (typeof jwtUser.email !== "string") { + if (!jwtUser.email || typeof jwtUser.email !== "string") { payload.logger.warn( "Using email as identity but no email is found in jwt token", );