Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3353440
D10577.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D10577.diff
View Options
diff --git a/lib/utils/action-utils.js b/lib/utils/action-utils.js
--- a/lib/utils/action-utils.js
+++ b/lib/utils/action-utils.js
@@ -199,8 +199,9 @@
keyserverID: string,
getInitialNotificationsEncryptedMessage?: () => Promise<string>,
): Promise<?ClientSessionChange> {
- const resolveInvalidatedCookie = getConfig().resolveInvalidatedCookie;
- if (!resolveInvalidatedCookie) {
+ const { resolveKeyserverSessionInvalidationUsingNativeCredentials } =
+ getConfig();
+ if (!resolveKeyserverSessionInvalidationUsingNativeCredentials) {
return null;
}
let newSessionChange = null;
@@ -287,7 +288,7 @@
);
return new Promise<boolean>(r => (callServerEndpointCallback = r));
};
- await resolveInvalidatedCookie(
+ await resolveKeyserverSessionInvalidationUsingNativeCredentials(
boundCallServerEndpoint,
boundCallKeyserverEndpoint,
dispatchRecoveryAttempt,
@@ -329,13 +330,16 @@
undefined,
keyserverID,
);
+ const { resolveKeyserverSessionInvalidationUsingNativeCredentials } =
+ getConfig();
// This function gets called before callServerEndpoint sends a request,
// to make sure that we're not in the middle of trying to recover
// an invalidated cookie
const waitIfCookieInvalidated = () => {
- if (!getConfig().resolveInvalidatedCookie) {
- // If there is no resolveInvalidatedCookie function, just let the caller
- // callServerEndpoint instance continue
+ if (!resolveKeyserverSessionInvalidationUsingNativeCredentials) {
+ // If there is no
+ // resolveKeyserverSessionInvalidationUsingNativeCredentials function,
+ // just let the caller callServerEndpoint instance continue
return Promise.resolve(null);
}
if (!currentlyWaitingForNewCookie) {
@@ -381,9 +385,10 @@
// its cookie, and is wondering if it should just like... give up?
// Or if there's a chance at redemption
const cookieInvalidationRecovery = (sessionChange: ClientSessionChange) => {
- if (!getConfig().resolveInvalidatedCookie) {
- // If there is no resolveInvalidatedCookie function, just let the caller
- // callServerEndpoint instance continue
+ if (!resolveKeyserverSessionInvalidationUsingNativeCredentials) {
+ // If there is no
+ // resolveKeyserverSessionInvalidationUsingNativeCredentials function,
+ // just let the caller callServerEndpoint instance continue
return Promise.resolve(null);
}
if (!loggedIn) {
diff --git a/lib/utils/config.js b/lib/utils/config.js
--- a/lib/utils/config.js
+++ b/lib/utils/config.js
@@ -9,7 +9,7 @@
import type { PlatformDetails } from '../types/device-types.js';
export type Config = {
- +resolveInvalidatedCookie: ?(
+ +resolveKeyserverSessionInvalidationUsingNativeCredentials: ?(
callServerEndpoint: CallServerEndpoint,
callKeyserverEndpoint: CallKeyserverEndpoint,
dispatchRecoveryAttempt: DispatchRecoveryAttempt,
diff --git a/native/account/resolve-invalidated-cookie.js b/native/account/resolve-invalidated-cookie.js
--- a/native/account/resolve-invalidated-cookie.js
+++ b/native/account/resolve-invalidated-cookie.js
@@ -11,7 +11,7 @@
import { store } from '../redux/redux-setup.js';
import { nativeLogInExtraInfoSelector } from '../selectors/account-selectors.js';
-async function resolveInvalidatedCookie(
+async function resolveKeyserverSessionInvalidationUsingNativeCredentials(
callServerEndpoint: CallServerEndpoint,
callKeyserverEndpoint: CallKeyserverEndpoint,
dispatchRecoveryAttempt: DispatchRecoveryAttempt,
@@ -46,4 +46,4 @@
);
}
-export { resolveInvalidatedCookie };
+export { resolveKeyserverSessionInvalidationUsingNativeCredentials };
diff --git a/native/config.js b/native/config.js
--- a/native/config.js
+++ b/native/config.js
@@ -4,11 +4,11 @@
import { registerConfig } from 'lib/utils/config.js';
-import { resolveInvalidatedCookie } from './account/resolve-invalidated-cookie.js';
+import { resolveKeyserverSessionInvalidationUsingNativeCredentials } from './account/resolve-invalidated-cookie.js';
import { persistConfig, codeVersion } from './redux/persist.js';
registerConfig({
- resolveInvalidatedCookie,
+ resolveKeyserverSessionInvalidationUsingNativeCredentials,
setSessionIDOnRequest: false,
calendarRangeInactivityLimit: 15 * 60 * 1000,
platformDetails: {
diff --git a/web/app.react.js b/web/app.react.js
--- a/web/app.react.js
+++ b/web/app.react.js
@@ -88,9 +88,8 @@
: null;
registerConfig({
- // We can't securely cache credentials on web, so we have no way to recover
- // from a cookie invalidation
- resolveInvalidatedCookie: null,
+ // We can't securely cache credentials on web
+ resolveKeyserverSessionInvalidationUsingNativeCredentials: null,
setSessionIDOnRequest: true,
// Never reset the calendar range
calendarRangeInactivityLimit: null,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 9:53 AM (21 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2574901
Default Alt Text
D10577.diff (4 KB)
Attached To
Mode
D10577: [lib][native] Rename resolveInvalidatedCookie to resolveKeyserverSessionInvalidationUsingNativeCredentials
Attached
Detach File
Event Timeline
Log In to Comment