Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3367212
D12618.id42251.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
D12618.id42251.diff
View Options
diff --git a/keyserver/src/keyserver.js b/keyserver/src/keyserver.js
--- a/keyserver/src/keyserver.js
+++ b/keyserver/src/keyserver.js
@@ -42,6 +42,7 @@
uploadDownloadResponder,
} from './uploads/uploads.js';
import { createAuthoritativeKeyserverConfigFiles } from './user/create-configs.js';
+import { fetchIdentityInfo } from './user/identity.js';
import { verifyUserLoggedIn } from './user/login.js';
import { initENSCache } from './utils/ens-cache.js';
import { initFCCache } from './utils/fc-cache.js';
@@ -102,18 +103,23 @@
const aes256Key = crypto.randomBytes(32).toString('hex');
const ed25519Key = await getContentSigningKey();
- await createAndMaintainTunnelbrokerWebsocket(aes256Key);
-
- console.log(
- '\nOpen the Comm app on your phone and scan the QR code below\n',
- );
- console.log('How to find the scanner:\n');
- console.log('Go to \x1b[1mProfile\x1b[0m');
- console.log('Select \x1b[1mLinked devices\x1b[0m');
- console.log('Click \x1b[1mAdd\x1b[0m on the top right');
-
- const url = qrCodeLinkURL(aes256Key, ed25519Key);
- qrcode.toString(url, (error, encodedURL) => console.log(encodedURL));
+ const [identityInfo] = await Promise.all([
+ fetchIdentityInfo(),
+ createAndMaintainTunnelbrokerWebsocket(aes256Key),
+ ]);
+
+ if (!identityInfo) {
+ console.log(
+ '\nOpen the Comm app on your phone and scan the QR code below\n',
+ );
+ console.log('How to find the scanner:\n');
+ console.log('Go to \x1b[1mProfile\x1b[0m');
+ console.log('Select \x1b[1mLinked devices\x1b[0m');
+ console.log('Click \x1b[1mAdd\x1b[0m on the top right');
+
+ const url = qrCodeLinkURL(aes256Key, ed25519Key);
+ qrcode.toString(url, (error, encodedURL) => console.log(encodedURL));
+ }
} catch (e) {
console.log('Error generating QR code', e);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 26, 2:09 PM (1 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2585028
Default Alt Text
D12618.id42251.diff (1 KB)
Attached To
Mode
D12618: [keyserver] don't display the QR code if keyserver is already logged in
Attached
Detach File
Event Timeline
Log In to Comment