From 52eaa69c625c4d78e7b97585d41dfa5a6a84eb3e Mon Sep 17 00:00:00 2001 From: Bereket Engida Date: Thu, 19 Dec 2024 18:15:27 +0300 Subject: [PATCH] fix: protect phone number login with 2fa --- packages/better-auth/src/plugins/two-factor/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/better-auth/src/plugins/two-factor/index.ts b/packages/better-auth/src/plugins/two-factor/index.ts index a3bb3fdc08..0f70d0d6dc 100644 --- a/packages/better-auth/src/plugins/two-factor/index.ts +++ b/packages/better-auth/src/plugins/two-factor/index.ts @@ -240,7 +240,8 @@ export const twoFactor = (options?: TwoFactorOptions) => { matcher(context) { return ( context.path === "/sign-in/email" || - context.path === "/sign-in/username" + context.path === "/sign-in/username" || + context.path === "/sign-in/phone-number" ); }, handler: createAuthMiddleware(async (ctx) => {