Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3555476
D10817.id36570.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D10817.id36570.diff
View Options
diff --git a/lib/actions/user-actions.js b/lib/actions/user-actions.js
--- a/lib/actions/user-actions.js
+++ b/lib/actions/user-actions.js
@@ -444,11 +444,27 @@
calendarQuery: CalendarQuery,
};
-const tempIdentityLoginActionTypes = Object.freeze({
- started: 'TEMP_IDENTITY_LOG_IN_STARTED',
- success: 'TEMP_IDENTITY_LOG_IN_SUCCESS',
- failed: 'TEMP_IDENTITY_LOG_IN_FAILED',
+const identityLogInActionTypes = Object.freeze({
+ started: 'IDENTITY_LOG_IN_STARTED',
+ success: 'IDENTITY_LOG_IN_SUCCESS',
+ failed: 'IDENTITY_LOG_IN_FAILED',
});
+function useIdentityPasswordLogIn(): (
+ username: string,
+ password: string,
+) => Promise<IdentityAuthResult> {
+ const client = React.useContext(IdentityClientContext);
+ const identityClient = client?.identityClient;
+ return React.useCallback(
+ (username, password) => {
+ if (!identityClient) {
+ throw new Error('Identity service client is not initialized');
+ }
+ return identityClient.logInPasswordUser(username, password);
+ },
+ [identityClient],
+ );
+}
const logInActionTypes = Object.freeze({
started: 'LOG_IN_STARTED',
@@ -741,7 +757,8 @@
getOlmSessionInitializationData,
mergeUserInfos,
logIn as logInRawAction,
- tempIdentityLoginActionTypes,
+ identityLogInActionTypes,
+ useIdentityPasswordLogIn,
useLogIn,
logInActionTypes,
useLogOut,
diff --git a/lib/types/redux-types.js b/lib/types/redux-types.js
--- a/lib/types/redux-types.js
+++ b/lib/types/redux-types.js
@@ -341,22 +341,6 @@
+payload: ?DeleteEntryResult,
+loadingInfo: LoadingInfo,
}
- | {
- +type: 'TEMP_IDENTITY_LOG_IN_STARTED',
- +loadingInfo: LoadingInfo,
- +payload?: void,
- }
- | {
- +type: 'TEMP_IDENTITY_LOG_IN_FAILED',
- +error: true,
- +payload: Error,
- +loadingInfo: LoadingInfo,
- }
- | {
- +type: 'TEMP_IDENTITY_LOG_IN_SUCCESS',
- +payload?: void,
- +loadingInfo: LoadingInfo,
- }
| {
+type: 'KEYSERVER_AUTH_STARTED',
+loadingInfo: LoadingInfo,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 27, 10:38 PM (6 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2721456
Default Alt Text
D10817.id36570.diff (2 KB)
Attached To
Mode
D10817: [lib] add identity password log in action
Attached
Detach File
Event Timeline
Log In to Comment