Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3390453
D10370.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
D10370.diff
View Options
diff --git a/native/utils/tunnelbroker-utils.js b/native/utils/tunnelbroker-utils.js
--- a/native/utils/tunnelbroker-utils.js
+++ b/native/utils/tunnelbroker-utils.js
@@ -4,20 +4,22 @@
import type { ConnectionInitializationMessage } from 'lib/types/tunnelbroker/session-types.js';
-import { getContentSigningKey } from './crypto-utils.js';
+import { commCoreModule } from '../native-modules.js';
import { useSelector } from '../redux/redux-utils.js';
function useTunnelbrokerInitMessage(): ?ConnectionInitializationMessage {
const [deviceID, setDeviceID] = React.useState<?string>();
- const userID = useSelector(state => state.currentUserInfo?.id);
+ const [userID, setUserID] = React.useState<?string>();
const accessToken = useSelector(state => state.commServicesAccessToken);
React.useEffect(() => {
void (async () => {
- const contentSigningKey = await getContentSigningKey();
+ const { userID: identityUserID, deviceID: contentSigningKey } =
+ await commCoreModule.getCommServicesAuthMetadata();
setDeviceID(contentSigningKey);
+ setUserID(identityUserID);
})();
- }, []);
+ }, [accessToken]);
return React.useMemo(() => {
if (!deviceID || !accessToken || !userID) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 30, 11:55 PM (20 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2602848
Default Alt Text
D10370.diff (1 KB)
Attached To
Mode
D10370: [native] update Tunnelbroker init message to rely on Identity `userID`
Attached
Detach File
Event Timeline
Log In to Comment