Page MenuHomePhabricator

D12110.id40384.diff
No OneTemporary

D12110.id40384.diff

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

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)

Event Timeline