Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F2904246
D6085.id20396.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D6085.id20396.diff
View Options
diff --git a/lib/actions/siwe-actions.js b/lib/actions/siwe-actions.js
--- a/lib/actions/siwe-actions.js
+++ b/lib/actions/siwe-actions.js
@@ -1,10 +1,12 @@
// @flow
import threadWatcher from '../shared/thread-watcher.js';
-import type { LogInResponse } from '../types/account-types.js';
+import type { LogInResult } from '../types/account-types.js';
+import { logInActionSources } from '../types/account-types.js';
import type { SIWEAuthServerCall } from '../types/siwe-types.js';
import type { CallServerEndpoint } from '../utils/call-server-endpoint';
import { getConfig } from '../utils/config.js';
+import { mergeUserInfos } from './user-actions.js';
const getSIWENonceActionTypes = Object.freeze({
started: 'GET_SIWE_NONCE_STARTED',
@@ -28,7 +30,7 @@
callServerEndpoint: CallServerEndpoint,
): ((
siweAuthPayload: SIWEAuthServerCall,
-) => Promise<LogInResponse>) => async siweAuthPayload => {
+) => Promise<LogInResult>) => async siweAuthPayload => {
const watchedIDs = threadWatcher.getWatchedIDs();
const response = await callServerEndpoint(
'siwe_auth',
@@ -39,7 +41,27 @@
},
siweAuthCallServerEndpointOptions,
);
- return response;
+ const userInfos = mergeUserInfos(
+ response.userInfos,
+ response.cookieChange.userInfos,
+ );
+ return {
+ threadInfos: response.cookieChange.threadInfos,
+ currentUserInfo: response.currentUserInfo,
+ calendarResult: {
+ calendarQuery: siweAuthPayload.calendarQuery,
+ rawEntryInfos: response.rawEntryInfos,
+ },
+ messagesResult: {
+ messageInfos: response.rawMessageInfos,
+ truncationStatus: response.truncationStatuses,
+ watchedIDsAtRequestTime: watchedIDs,
+ currentAsOf: response.serverTime,
+ },
+ userInfos,
+ updatesCurrentAsOf: response.serverTime,
+ logInActionSource: logInActionSources.logInFromNativeSIWE,
+ };
};
export { getSIWENonceActionTypes, getSIWENonce, siweAuthActionTypes, siweAuth };
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
@@ -242,6 +242,7 @@
deleteAccount,
deleteAccountActionTypes,
getSessionPublicKeys,
+ mergeUserInfos,
logIn,
logInActionTypes,
logOut,
diff --git a/lib/types/account-types.js b/lib/types/account-types.js
--- a/lib/types/account-types.js
+++ b/lib/types/account-types.js
@@ -86,6 +86,7 @@
sqliteLoadFailure: 'SQLITE_LOAD_FAILURE',
logInFromWebForm: 'LOG_IN_FROM_WEB_FORM',
logInFromNativeForm: 'LOG_IN_FROM_NATIVE_FORM',
+ logInFromNativeSIWE: 'LOG_IN_FROM_NATIVE_SIWE',
});
export type LogInActionSource = $Values<typeof logInActionSources>;
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
@@ -7,7 +7,6 @@
LogInResult,
RegisterResult,
DefaultNotificationPayload,
- LogInResponse,
} from './account-types';
import type {
ActivityUpdateSuccessPayload,
@@ -902,7 +901,7 @@
}
| {
+type: 'SIWE_AUTH_SUCCESS',
- +payload: LogInResponse,
+ +payload: LogInResult,
+loadingInfo: LoadingInfo,
}
| {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Oct 7, 12:47 AM (21 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2251783
Default Alt Text
D6085.id20396.diff (3 KB)
Attached To
Mode
D6085: [lib] Modify `siweAuth(...)` return type from `LogInResponse` to `LogInResult`
Attached
Detach File
Event Timeline
Log In to Comment