Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33309970
D11690.1768806320.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D11690.1768806320.diff
View Options
diff --git a/lib/components/keyserver-connection-handler.js b/lib/components/keyserver-connection-handler.js
--- a/lib/components/keyserver-connection-handler.js
+++ b/lib/components/keyserver-connection-handler.js
@@ -124,7 +124,7 @@
invariant(identityContext, 'Identity context should be set');
const { identityClient, getAuthMetadata } = identityContext;
- const preRequestUserInfo = useSelector(state => state.currentUserInfo);
+ const currentUserInfo = useSelector(state => state.currentUserInfo);
const innerPerformAuth = React.useCallback(
(
authActionSource: AuthActionSource,
@@ -185,7 +185,7 @@
initialNotificationsEncryptedMessage: notifsSession,
},
},
- preRequestUserInfo,
+ preRequestUserInfo: currentUserInfo,
});
await dispatchActionPromise(keyserverAuthActionTypes, authPromise);
@@ -216,7 +216,7 @@
identityClient,
keyserverID,
olmAPI,
- preRequestUserInfo,
+ currentUserInfo,
],
);
@@ -362,14 +362,21 @@
const cancelPendingAuth = React.useRef<?() => void>(null);
const prevPerformAuth = React.useRef(performAuth);
- const isUserAuthenticated = useSelector(isLoggedInToKeyserver(keyserverID));
const hasAccessToken = useSelector(state => !!state.commServicesAccessToken);
+ const isUserLoggedInToKeyserver = useSelector(
+ isLoggedInToKeyserver(keyserverID),
+ );
+ const canInitiateRecovery =
+ !!currentUserInfo &&
+ !currentUserInfo.anonymous &&
+ isUserLoggedInToKeyserver;
+
const cancelPendingRecovery = React.useRef<?() => void>(null);
const prevPerformRecovery = React.useRef(performRecovery);
React.useEffect(() => {
- if (activeSessionRecovery && isUserAuthenticated) {
+ if (activeSessionRecovery && canInitiateRecovery) {
cancelPendingAuth.current?.();
cancelPendingAuth.current = null;
@@ -397,7 +404,7 @@
if (
!usingCommServicesAccessToken ||
- isUserAuthenticated ||
+ isUserLoggedInToKeyserver ||
!hasAccessToken
) {
return;
@@ -420,7 +427,8 @@
authInProgress,
performRecovery,
hasAccessToken,
- isUserAuthenticated,
+ isUserLoggedInToKeyserver,
+ canInitiateRecovery,
performAuth,
]);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 19, 7:05 AM (8 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5955075
Default Alt Text
D11690.1768806320.diff (2 KB)
Attached To
Mode
D11690: [lib] Don't initiate keyserver session recovery if currentUserInfo is not set
Attached
Detach File
Event Timeline
Log In to Comment