Page MenuHomePhabricator

D12678.id42113.diff
No OneTemporary

D12678.id42113.diff

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
@@ -2,8 +2,12 @@
import * as React from 'react';
-import { logOutActionTypes, useLogOut } from 'lib/actions/user-actions.js';
-import { usePasswordLogIn } from 'lib/hooks/login-hooks.js';
+import {
+ identityLogInActionTypes,
+ useIdentityPasswordLogIn,
+ logOutActionTypes,
+ useLogOut,
+} from 'lib/actions/user-actions.js';
import { accountHasPassword } from 'lib/shared/account-utils.js';
import { securityUpdateLogoutText } from 'lib/types/alert-types.js';
import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js';
@@ -23,7 +27,7 @@
const hasAccessToken = useSelector(state => !!state.commServicesAccessToken);
const dataLoaded = useSelector(state => state.dataLoaded);
- const callIdentityPasswordLogIn = usePasswordLogIn();
+ const callIdentityPasswordLogIn = useIdentityPasswordLogIn();
const handleLogOutAndAlert = React.useCallback(() => {
void dispatchActionPromise(logOutActionTypes, callLogOut());
@@ -49,16 +53,21 @@
return;
}
+ const logInPromise = callIdentityPasswordLogIn(
+ nativeCredentials.username,
+ nativeCredentials.password,
+ );
+ void dispatchActionPromise(identityLogInActionTypes, logInPromise);
+
try {
- await callIdentityPasswordLogIn(
- nativeCredentials.username,
- nativeCredentials.password,
- );
+ await logInPromise;
} catch (e) {
+ console.log('BackgroundIdentityLoginHandler failed identity login', e);
handleLogOutAndAlert();
}
}, [
callIdentityPasswordLogIn,
+ dispatchActionPromise,
dataLoaded,
handleLogOutAndAlert,
hasAccessToken,

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 2, 6:13 PM (21 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2607890
Default Alt Text
D12678.id42113.diff (1 KB)

Event Timeline