Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3714408
D11805.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
10 KB
Referenced Files
None
Subscribers
None
D11805.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
@@ -8,7 +8,7 @@
import threadWatcher from '../shared/thread-watcher.js';
import { permissionsAndAuthRelatedRequestTimeout } from '../shared/timeouts.js';
import {
- type LogInResult,
+ type LegacyLogInResult,
logInActionSources,
} from '../types/account-types.js';
import type { SIWEAuthServerCall } from '../types/siwe-types.js';
@@ -43,7 +43,7 @@
): ((
siweAuthPayload: SIWEAuthServerCall,
options?: ?CallSingleKeyserverEndpointOptions,
- ) => Promise<LogInResult>) =>
+ ) => Promise<LegacyLogInResult>) =>
async (siweAuthPayload, options) => {
const watchedIDs = threadWatcher.getWatchedIDs();
const deviceTokenUpdateRequest =
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
@@ -23,8 +23,8 @@
import threadWatcher from '../shared/thread-watcher.js';
import { permissionsAndAuthRelatedRequestTimeout } from '../shared/timeouts.js';
import type {
- LogInInfo,
- LogInResult,
+ LegacyLogInInfo,
+ LegacyLogInResult,
LegacyRegisterResult,
LegacyRegisterInfo,
UpdateUserSettingsRequest,
@@ -571,7 +571,7 @@
const legacyLogIn =
(
callKeyserverEndpoint: CallKeyserverEndpoint,
- ): ((input: LogInInfo) => Promise<LogInResult>) =>
+ ): ((input: LegacyLogInInfo) => Promise<LegacyLogInResult>) =>
async logInInfo => {
const watchedIDs = threadWatcher.getWatchedIDs();
const {
@@ -671,7 +671,9 @@
};
};
-function useLegacyLogIn(): (input: LogInInfo) => Promise<LogInResult> {
+function useLegacyLogIn(): (
+ input: LegacyLogInInfo,
+) => Promise<LegacyLogInResult> {
return useKeyserverCall(legacyLogIn);
}
diff --git a/lib/reducers/report-store-reducer.test.js b/lib/reducers/report-store-reducer.test.js
--- a/lib/reducers/report-store-reducer.test.js
+++ b/lib/reducers/report-store-reducer.test.js
@@ -1,7 +1,7 @@
// @flow
import reduceReportStore from './report-store-reducer.js';
-import type { LogInResult } from '../types/account-types.js';
+import type { LegacyLogInResult } from '../types/account-types.js';
import type { LoadingInfo } from '../types/loading-types.js';
import type { AppState, BaseAction } from '../types/redux-types.js';
import {
@@ -83,7 +83,7 @@
};
describe('session change test', () => {
- const mockLogInResult: LogInResult = ({
+ const mockLogInResult: LegacyLogInResult = ({
currentUserInfo: { id: '-1', username: 'test' },
}: any);
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
@@ -142,7 +142,7 @@
export type AuthActionSource = LogInActionSource | RecoveryActionSource;
-export type LogInStartingPayload = {
+export type LegacyLogInStartingPayload = {
+calendarQuery: CalendarQuery,
+authActionSource?: AuthActionSource,
};
@@ -155,7 +155,7 @@
+preRequestUserInfo: ?CurrentUserInfo,
};
-export type LogInInfo = {
+export type LegacyLogInInfo = {
...LogInExtraInfo,
+username: string,
+password: string,
@@ -199,7 +199,7 @@
}>,
}>;
-export type LogInResult = {
+export type LegacyLogInResult = {
+threadInfos: RawThreadInfos,
+currentUserInfo: LoggedInUserInfo,
+messagesResult: GenericMessagesResult,
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
@@ -3,8 +3,8 @@
import type {
LogOutResult,
KeyserverLogOutResult,
- LogInStartingPayload,
- LogInResult,
+ LegacyLogInStartingPayload,
+ LegacyLogInResult,
LegacyRegisterResult,
DefaultNotificationPayload,
ClaimUsernameResponse,
@@ -393,7 +393,7 @@
| {
+type: 'LEGACY_LOG_IN_STARTED',
+loadingInfo: LoadingInfo,
- +payload: LogInStartingPayload,
+ +payload: LegacyLogInStartingPayload,
}
| {
+type: 'LEGACY_LOG_IN_FAILED',
@@ -403,13 +403,13 @@
}
| {
+type: 'LEGACY_LOG_IN_SUCCESS',
- +payload: LogInResult,
+ +payload: LegacyLogInResult,
+loadingInfo: LoadingInfo,
}
| {
+type: 'LEGACY_KEYSERVER_REGISTER_STARTED',
+loadingInfo: LoadingInfo,
- +payload: LogInStartingPayload,
+ +payload: LegacyLogInStartingPayload,
}
| {
+type: 'LEGACY_KEYSERVER_REGISTER_FAILED',
@@ -1084,12 +1084,12 @@
}
| {
+type: 'LEGACY_SIWE_AUTH_STARTED',
- +payload: LogInStartingPayload,
+ +payload: LegacyLogInStartingPayload,
+loadingInfo: LoadingInfo,
}
| {
+type: 'LEGACY_SIWE_AUTH_SUCCESS',
- +payload: LogInResult,
+ +payload: LegacyLogInResult,
+loadingInfo: LoadingInfo,
}
| {
diff --git a/native/account/legacy-register-panel.react.js b/native/account/legacy-register-panel.react.js
--- a/native/account/legacy-register-panel.react.js
+++ b/native/account/legacy-register-panel.react.js
@@ -29,7 +29,7 @@
LegacyRegisterInfo,
LogInExtraInfo,
LegacyRegisterResult,
- LogInStartingPayload,
+ LegacyLogInStartingPayload,
} from 'lib/types/account-types.js';
import type { LoadingStatus } from 'lib/types/loading-types.js';
import type { Dispatch } from 'lib/types/redux-types.js';
@@ -320,7 +320,9 @@
initialNotificationsEncryptedMessage,
}),
undefined,
- ({ calendarQuery: extraInfo.calendarQuery }: LogInStartingPayload),
+ ({
+ calendarQuery: extraInfo.calendarQuery,
+ }: LegacyLogInStartingPayload),
);
}
};
diff --git a/native/account/log-in-panel.react.js b/native/account/log-in-panel.react.js
--- a/native/account/log-in-panel.react.js
+++ b/native/account/log-in-panel.react.js
@@ -21,10 +21,10 @@
} from 'lib/shared/account-utils.js';
import { useInitialNotificationsEncryptedMessage } from 'lib/shared/crypto-utils.js';
import {
- type LogInInfo,
+ type LegacyLogInInfo,
type LogInExtraInfo,
- type LogInResult,
- type LogInStartingPayload,
+ type LegacyLogInResult,
+ type LegacyLogInStartingPayload,
logInActionSources,
} from 'lib/types/account-types.js';
import type { LoadingStatus } from 'lib/types/loading-types.js';
@@ -69,7 +69,7 @@
+loadingStatus: LoadingStatus,
+logInExtraInfo: () => Promise<LogInExtraInfo>,
+dispatchActionPromise: DispatchActionPromise,
- +legacyLogIn: (logInInfo: LogInInfo) => Promise<LogInResult>,
+ +legacyLogIn: (logInInfo: LegacyLogInInfo) => Promise<LegacyLogInResult>,
+identityPasswordLogIn: (username: string, password: string) => Promise<void>,
+getInitialNotificationsEncryptedMessage: () => Promise<string>,
};
@@ -274,11 +274,13 @@
initialNotificationsEncryptedMessage,
}),
undefined,
- ({ calendarQuery: extraInfo.calendarQuery }: LogInStartingPayload),
+ ({ calendarQuery: extraInfo.calendarQuery }: LegacyLogInStartingPayload),
);
};
- async legacyLogInAction(extraInfo: LogInExtraInfo): Promise<LogInResult> {
+ async legacyLogInAction(
+ extraInfo: LogInExtraInfo,
+ ): Promise<LegacyLogInResult> {
try {
const result = await this.props.legacyLogIn({
...extraInfo,
diff --git a/native/account/registration/registration-server-call.js b/native/account/registration/registration-server-call.js
--- a/native/account/registration/registration-server-call.js
+++ b/native/account/registration/registration-server-call.js
@@ -14,7 +14,7 @@
import { useLegacyAshoatKeyserverCall } from 'lib/keyserver-conn/legacy-keyserver-call.js';
import { isLoggedInToKeyserver } from 'lib/selectors/user-selectors.js';
import {
- type LogInStartingPayload,
+ type LegacyLogInStartingPayload,
logInActionSources,
} from 'lib/types/account-types.js';
import { syncedMetadataNames } from 'lib/types/synced-metadata-types.js';
@@ -187,7 +187,9 @@
legacyKeyserverRegisterActionTypes,
legacyKeyserverRegisterPromise,
undefined,
- ({ calendarQuery: extraInfo.calendarQuery }: LogInStartingPayload),
+ ({
+ calendarQuery: extraInfo.calendarQuery,
+ }: LegacyLogInStartingPayload),
);
await legacyKeyserverRegisterPromise;
},
diff --git a/native/account/siwe-hooks.js b/native/account/siwe-hooks.js
--- a/native/account/siwe-hooks.js
+++ b/native/account/siwe-hooks.js
@@ -14,7 +14,7 @@
import { useLegacyAshoatKeyserverCall } from 'lib/keyserver-conn/legacy-keyserver-call.js';
import { useInitialNotificationsEncryptedMessage } from 'lib/shared/crypto-utils.js';
import type {
- LogInStartingPayload,
+ LegacyLogInStartingPayload,
LogInExtraInfo,
} from 'lib/types/account-types.js';
import type { IdentityWalletRegisterInput } from 'lib/types/siwe-types.js';
@@ -86,7 +86,9 @@
legacySiweAuthActionTypes,
siwePromise,
undefined,
- ({ calendarQuery: extraInfo.calendarQuery }: LogInStartingPayload),
+ ({
+ calendarQuery: extraInfo.calendarQuery,
+ }: LegacyLogInStartingPayload),
);
await siwePromise;
diff --git a/web/account/siwe-login-form.react.js b/web/account/siwe-login-form.react.js
--- a/web/account/siwe-login-form.react.js
+++ b/web/account/siwe-login-form.react.js
@@ -25,7 +25,7 @@
import { logInExtraInfoSelector } from 'lib/selectors/account-selectors.js';
import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors.js';
import type {
- LogInStartingPayload,
+ LegacyLogInStartingPayload,
LogInExtraInfo,
} from 'lib/types/account-types.js';
import { SIWEMessageTypes } from 'lib/types/siwe-types.js';
@@ -151,7 +151,9 @@
legacySiweAuthActionTypes,
callLegacySIWEAuthEndpoint(message, signature, logInExtraInfo),
undefined,
- ({ calendarQuery: logInExtraInfo.calendarQuery }: LogInStartingPayload),
+ ({
+ calendarQuery: logInExtraInfo.calendarQuery,
+ }: LegacyLogInStartingPayload),
);
},
[callLegacySIWEAuthEndpoint, dispatchActionPromise, logInExtraInfo],
diff --git a/web/account/traditional-login-form.react.js b/web/account/traditional-login-form.react.js
--- a/web/account/traditional-login-form.react.js
+++ b/web/account/traditional-login-form.react.js
@@ -17,7 +17,7 @@
} from 'lib/shared/account-utils.js';
import type {
LogInExtraInfo,
- LogInStartingPayload,
+ LegacyLogInStartingPayload,
} from 'lib/types/account-types.js';
import { logInActionSources } from 'lib/types/account-types.js';
import { getMessageForException } from 'lib/utils/errors.js';
@@ -172,7 +172,7 @@
undefined,
({
calendarQuery: loginExtraInfo.calendarQuery,
- }: LogInStartingPayload),
+ }: LegacyLogInStartingPayload),
);
}
},
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 9, 8:10 AM (9 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2830729
Default Alt Text
D11805.diff (10 KB)
Attached To
Mode
D11805: [lib][native][web] Rename some legacy login types
Attached
Detach File
Event Timeline
Log In to Comment