diff --git a/native/components/background-identity-login-handler.react.js b/native/components/background-identity-login-handler.react.js --- a/native/components/background-identity-login-handler.react.js +++ b/native/components/background-identity-login-handler.react.js @@ -34,8 +34,15 @@ Alert.alert('Security update', securityUpdateLogoutText, [{ text: 'OK' }]); }, [dispatchActionPromise, callLogOut]); + const loginAttemptedRef = React.useRef(false); + const logInIfPossibleElseLogOut = React.useCallback(async () => { - if (hasAccessToken || !dataLoaded || !usingCommServicesAccessToken) { + if ( + hasAccessToken || + !dataLoaded || + !usingCommServicesAccessToken || + loginAttemptedRef.current + ) { return; } @@ -53,6 +60,11 @@ return; } + if (loginAttemptedRef.current) { + return; + } + loginAttemptedRef.current = true; + const logInPromise = callIdentityPasswordLogIn( nativeCredentials.username, nativeCredentials.password,