From a91915f2dac23743fb7e32031bfbb950b6c018db Mon Sep 17 00:00:00 2001 From: Andrew Rosiclair Date: Wed, 13 Nov 2024 11:51:03 -0500 Subject: [PATCH] use validateSecondaryLogin to fix log out bug --- src/pages/settings/Wallet/VerifyAccountPage.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pages/settings/Wallet/VerifyAccountPage.tsx b/src/pages/settings/Wallet/VerifyAccountPage.tsx index 3bd3c2aa7000..600d81426170 100644 --- a/src/pages/settings/Wallet/VerifyAccountPage.tsx +++ b/src/pages/settings/Wallet/VerifyAccountPage.tsx @@ -21,7 +21,6 @@ function VerifyAccountPage({route}: VerifyAccountPageProps) { const loginData = loginList?.[contactMethod]; const validateLoginError = ErrorUtils.getEarliestErrorField(loginData, 'validateLogin'); const [isUserValidated] = useOnyx(ONYXKEYS.USER, {selector: (user) => !!user?.validated}); - const [accountID] = useOnyx(ONYXKEYS.SESSION, {selector: (session) => session?.accountID ?? 0}); const [isValidateCodeActionModalVisible, setIsValidateCodeActionModalVisible] = useState(true); @@ -31,9 +30,9 @@ function VerifyAccountPage({route}: VerifyAccountPageProps) { const handleSubmitForm = useCallback( (validateCode: string) => { - User.validateLogin(accountID ?? 0, validateCode); + User.validateSecondaryLogin(loginList, contactMethod, validateCode); }, - [accountID], + [loginList, contactMethod], ); const clearError = useCallback(() => {