From 6429e4ccb5761fca8a1c7e63d6750d7728a19f74 Mon Sep 17 00:00:00 2001 From: Abhinav Date: Thu, 9 Nov 2023 14:29:06 +0530 Subject: [PATCH] bypass verify if srp setuped and active --- packages/accounts/pages/verify.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/accounts/pages/verify.tsx b/packages/accounts/pages/verify.tsx index c7fe12920..0383a68b8 100644 --- a/packages/accounts/pages/verify.tsx +++ b/packages/accounts/pages/verify.tsx @@ -11,7 +11,7 @@ import { setIsFirstLogin } from '@ente/shared/storage/localStorage/helpers'; import { clearKeys } from '@ente/shared/storage/sessionStorage'; import { PAGES } from '../constants/pages'; import { KeyAttributes, User } from '@ente/shared/user/types'; -import { SRPSetupAttributes } from '../types/srp'; +import { SRPAttributes, SRPSetupAttributes } from '../types/srp'; import { Box, Typography } from '@mui/material'; import FormPaperTitle from '@ente/shared/components/Form/FormPaper/Title'; import FormPaper from '@ente/shared/components/Form/FormPaper'; @@ -41,6 +41,9 @@ export default function VerifyPage({ appContext, router, appName }: PageProps) { const keyAttributes: KeyAttributes = getData( LS_KEYS.KEY_ATTRIBUTES ); + const srpAttributes: SRPAttributes = getData( + LS_KEYS.SRP_ATTRIBUTES + ); if (!user?.email) { router.push(PAGES.ROOT); } else if ( @@ -48,6 +51,11 @@ export default function VerifyPage({ appContext, router, appName }: PageProps) { (user.token || user.encryptedToken) ) { router.push(PAGES.CREDENTIALS); + } else if ( + srpAttributes?.srpUserID && + !srpAttributes?.isEmailMFAEnabled + ) { + router.push(PAGES.CREDENTIALS); } else { setEmail(user.email); }