Page MenuHomePhabricator

D14031.id45985.diff
No OneTemporary

D14031.id45985.diff

diff --git a/lib/identity-search/identity-search-context.js b/lib/identity-search/identity-search-context.js
--- a/lib/identity-search/identity-search-context.js
+++ b/lib/identity-search/identity-search-context.js
@@ -4,6 +4,7 @@
import * as React from 'react';
import uuid from 'uuid';
+import { useInvalidCSATLogOut } from '../actions/user-actions.js';
import { identitySearchURL } from '../facts/identity-search.js';
import {
clientRequestVisualTimeout,
@@ -64,6 +65,7 @@
const [connected, setConnected] = React.useState(false);
const listeners = React.useRef<Set<IdentitySearchSocketListener>>(new Set());
const getIdentitySearchAuthMessage = useGetIdentitySearchAuthMessage();
+ const invalidTokenLogOut = useInvalidCSATLogOut();
const [identitySearchAuthMessage, setIdentitySearchAuthMessage] =
React.useState<?IdentitySearchAuthMessage>(null);
const socket = React.useRef<?WebSocket>(null);
@@ -170,6 +172,10 @@
'Success for already connected socket',
);
} else {
+ if (message.status.data?.includes('UnauthorizedDevice')) {
+ void invalidTokenLogOut();
+ return;
+ }
setConnected(false);
console.log(
'creating session with Identity Search error:',
@@ -207,6 +213,7 @@
identitySearchAuthMessage,
resetHeartbeatTimeout,
stopHeartbeatTimeout,
+ invalidTokenLogOut,
]);
const sendPrefixQuery: (

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 29, 11:31 PM (20 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2597638
Default Alt Text
D14031.id45985.diff (1 KB)

Event Timeline