Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3400197
D12110.id40384.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
D12110.id40384.diff
View Options
diff --git a/web/account/qr-code-login.react.js b/web/account/qr-code-login.react.js
--- a/web/account/qr-code-login.react.js
+++ b/web/account/qr-code-login.react.js
@@ -68,7 +68,7 @@
}
function QRCodeLogin(): React.Node {
- const [deviceKeys, setDeviceKeys] =
+ const [qrData, setQRData] =
React.useState<?{ +deviceID: string, +aesKey: string }>();
const { setUnauthorizedDeviceID } = useTunnelbroker();
@@ -111,7 +111,7 @@
const aesKeyAsHexString: string = uintArrayToHexString(rawAESKey);
setUnauthorizedDeviceID(ed25519);
- setDeviceKeys({ deviceID: ed25519, aesKey: aesKeyAsHexString });
+ setQRData({ deviceID: ed25519, aesKey: aesKeyAsHexString });
} catch (err) {
console.error('Failed to generate QR Code:', err);
}
@@ -122,18 +122,15 @@
}, [generateQRCode]);
const qrCodeURL = React.useMemo(
- () =>
- deviceKeys
- ? qrCodeLinkURL(deviceKeys.aesKey, deviceKeys.deviceID)
- : undefined,
- [deviceKeys],
+ () => (qrData ? qrCodeLinkURL(qrData.aesKey, qrData.deviceID) : undefined),
+ [qrData],
);
return (
<>
<QRAuthHandler
- secondaryDeviceID={deviceKeys?.deviceID}
- aesKey={deviceKeys?.aesKey}
+ secondaryDeviceID={qrData?.deviceID}
+ aesKey={qrData?.aesKey}
performSecondaryDeviceRegistration={performRegistration}
composeMessage={composeTunnelbrokerMessage}
processMessage={parseTunnelbrokerMessage}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 3, 6:35 AM (1 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2610607
Default Alt Text
D12110.id40384.diff (1 KB)
Attached To
Mode
D12110: [web] Rename deviceKeys to qrData in QRCodeLogin
Attached
Detach File
Event Timeline
Log In to Comment