@vibe-db/cli 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commands/signup.js +8 -4
package/package.json
CHANGED
package/src/commands/signup.js
CHANGED
|
@@ -18,15 +18,19 @@ async function signupWithGitHub() {
|
|
|
18
18
|
const data = await api.startDeviceAuth();
|
|
19
19
|
const { device_code, user_code, verification_uri, interval } = data;
|
|
20
20
|
|
|
21
|
+
// Build URL with pre-populated code for better UX
|
|
22
|
+
const urlWithCode = `${verification_uri}?code=${formatUserCode(user_code)}`;
|
|
23
|
+
|
|
21
24
|
console.log(chalk.bold('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
|
|
22
|
-
console.log(chalk.cyan.bold(` Open: ${
|
|
23
|
-
console.log(chalk.yellow.bold(`
|
|
25
|
+
console.log(chalk.cyan.bold(` Open: ${urlWithCode}`));
|
|
26
|
+
console.log(chalk.yellow.bold(` Your code: ${formatUserCode(user_code)}`));
|
|
24
27
|
console.log(chalk.bold('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'));
|
|
25
28
|
|
|
29
|
+
// Try to open browser automatically with pre-populated code
|
|
26
30
|
try {
|
|
27
31
|
const open = (await import('open')).default;
|
|
28
|
-
await open(
|
|
29
|
-
console.log(chalk.gray('Opened browser
|
|
32
|
+
await open(urlWithCode);
|
|
33
|
+
console.log(chalk.gray('Opened browser with code pre-filled...\n'));
|
|
30
34
|
} catch (err) {
|
|
31
35
|
console.log(chalk.gray('Please open the URL manually\n'));
|
|
32
36
|
}
|