From 0c908810bd0ea19bb2e7eda577465e23a062d168 Mon Sep 17 00:00:00 2001 From: Huu Le <20178761+huult@users.noreply.github.com> Date: Mon, 9 Dec 2024 20:50:46 +0700 Subject: [PATCH] Validate code before signing in --- src/pages/ValidateLoginPage/index.website.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pages/ValidateLoginPage/index.website.tsx b/src/pages/ValidateLoginPage/index.website.tsx index eb2973e641ca..2d1af21ceeab 100644 --- a/src/pages/ValidateLoginPage/index.website.tsx +++ b/src/pages/ValidateLoginPage/index.website.tsx @@ -6,6 +6,7 @@ import JustSignedInModal from '@components/ValidateCode/JustSignedInModal'; import ValidateCodeModal from '@components/ValidateCode/ValidateCodeModal'; import desktopLoginRedirect from '@libs/desktopLoginRedirect'; import Navigation from '@libs/Navigation/Navigation'; +import * as ValidationUtils from '@libs/ValidationUtils'; import * as Session from '@userActions/Session'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; @@ -48,6 +49,10 @@ function ValidateLoginPage({ return; } + if (!ValidationUtils.isValidValidateCode(validateCode)) { + return; + } + // The user has initiated the sign in process on the same browser, in another tab. Session.signInWithValidateCode(Number(accountID), validateCode);