Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3396833
D12678.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D12678.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 2, 2:41 PM (20 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2607890
Default Alt Text
D12678.diff (1 KB)
Attached To
Mode
D12678: [native] Don't bother with keyserver auth in BackgroundIdentityLoginHandler
Attached
Detach File
Event Timeline
Log In to Comment