Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3382751
D11228.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
D11228.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
@@ -35,7 +35,10 @@
import { getConfig } from '../utils/config.js';
import { useDispatchActionPromise } from '../utils/redux-promise-utils.js';
import { useSelector } from '../utils/redux-utils.js';
-import { usingCommServicesAccessToken } from '../utils/services-utils.js';
+import {
+ usingCommServicesAccessToken,
+ relyingOnAuthoritativeKeyserver,
+} from '../utils/services-utils.js';
import sleep from '../utils/sleep.js';
type Props = {
@@ -84,10 +87,14 @@
}, [calendarFilters, keyserverID, navInfo.endDate, navInfo.startDate]);
React.useEffect(() => {
- if (hasConnectionIssue && !usingCommServicesAccessToken) {
+ if (
+ hasConnectionIssue &&
+ keyserverID === authoritativeKeyserverID &&
+ relyingOnAuthoritativeKeyserver
+ ) {
void dispatchActionPromise(logOutActionTypes, callLogOut());
}
- }, [callLogOut, hasConnectionIssue, dispatchActionPromise]);
+ }, [callLogOut, hasConnectionIssue, dispatchActionPromise, keyserverID]);
const identityContext = React.useContext(IdentityClientContext);
invariant(identityContext, 'Identity context should be set');
@@ -170,7 +177,11 @@
e,
);
- if (!dataLoaded && keyserverID === authoritativeKeyserverID()) {
+ if (
+ !dataLoaded &&
+ keyserverID === authoritativeKeyserverID() &&
+ relyingOnAuthoritativeKeyserver
+ ) {
await dispatchActionPromise(logOutActionTypes, callLogOut());
}
} finally {
diff --git a/lib/utils/services-utils.js b/lib/utils/services-utils.js
--- a/lib/utils/services-utils.js
+++ b/lib/utils/services-utils.js
@@ -4,8 +4,15 @@
import type { AuthMetadata } from '../shared/identity-client-context.js';
+// If this is true then we're using the identity service for auth. After we
+// auth, the identity service gives us a CSAT, which we can use to auth with
+// other Comm services.
const usingCommServicesAccessToken = false;
+// If this is false, then the app no longer needs to rely on being connected to
+// an authoritative keyserver for things like DMs.
+const relyingOnAuthoritativeKeyserver = true;
+
function handleHTTPResponseError(response: Response): void {
if (!response.ok) {
const { status, statusText } = response;
@@ -33,6 +40,7 @@
export {
handleHTTPResponseError,
usingCommServicesAccessToken,
+ relyingOnAuthoritativeKeyserver,
createHTTPAuthorizationHeader,
createDefaultHTTPRequestHeaders,
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 29, 11:50 AM (22 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2596887
Default Alt Text
D11228.diff (2 KB)
Attached To
Mode
D11228: [lib] Introduce relyingOnAuthoritativeKeyserver constant
Attached
Detach File
Event Timeline
Log In to Comment