Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3302901
D13956.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D13956.diff
View Options
diff --git a/lib/tunnelbroker/tunnelbroker-context.js b/lib/tunnelbroker/tunnelbroker-context.js
--- a/lib/tunnelbroker/tunnelbroker-context.js
+++ b/lib/tunnelbroker/tunnelbroker-context.js
@@ -8,6 +8,7 @@
import { PeerToPeerProvider } from './peer-to-peer-context.js';
import { PeerToPeerMessageHandler } from './peer-to-peer-message-handler.js';
import type { SecondaryTunnelbrokerConnection } from './secondary-tunnelbroker-connection.js';
+import { useInvalidCSATLogOut } from '../actions/user-actions.js';
import { PeerOlmSessionCreatorProvider } from '../components/peer-olm-session-creator-provider.react.js';
import { tunnnelbrokerURL } from '../facts/tunnelbroker.js';
import { DMOpsQueueHandler } from '../shared/dm-ops/dm-ops-queue-handler.react.js';
@@ -114,6 +115,8 @@
state => state.lifecycleState !== 'background',
);
+ const invalidTokenLogOut = useInvalidCSATLogOut();
+
const [unauthorizedDeviceID, setUnauthorizedDeviceID] =
React.useState<?string>(null);
const isAuthorized = !unauthorizedDeviceID;
@@ -293,6 +296,10 @@
'received ConnectionInitializationResponse with status: Success for already connected socket',
);
} else {
+ if (message.status.data?.includes('UnauthorizedDevice')) {
+ void invalidTokenLogOut();
+ return;
+ }
setSocketState({ connected: false, retryCount: 0 });
console.log(
'creating session with Tunnelbroker error:',
@@ -342,6 +349,7 @@
createInitMessage,
socketState.connected,
socketState.retryCount,
+ invalidTokenLogOut,
]);
const sendMessage: (request: DeviceToTunnelbrokerRequest) => Promise<void> =
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 19, 9:00 AM (18 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2537571
Default Alt Text
D13956.diff (1 KB)
Attached To
Mode
D13956: [lib] Log out on failed Tunnelbroker auth
Attached
Detach File
Event Timeline
Log In to Comment