vibecodingmachine-cli 1.0.6 → 1.0.8

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/utils/auth.js +21 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibecodingmachine-cli",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Command-line interface for Vibe Coding Machine - Autonomous development",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/utils/auth.js CHANGED
@@ -240,8 +240,9 @@ class CLIAuth {
240
240
  // VS Code Remote SSH - use optimized flow with instructions
241
241
  if (isVSCodeRemote && !options.headless) {
242
242
  console.log(chalk.cyan('\nšŸ” VS Code Remote SSH Detected!\n'));
243
- console.log(chalk.gray('VS Code will automatically forward port 3000 to your laptop.'));
244
- console.log(chalk.gray('The authentication URL will be shown below - click it to login.\n'));
243
+ console.log(chalk.yellow('āš ļø IMPORTANT: VS Code will show "Port 3000 is now available"'));
244
+ console.log(chalk.yellow(' → DO NOT click that notification!'));
245
+ console.log(chalk.yellow(' → Instead, Ctrl+Click the authentication URL shown below\n'));
245
246
  }
246
247
 
247
248
  // Standard browser-based login
@@ -252,10 +253,28 @@ class CLIAuth {
252
253
  const codeVerifier = generateCodeVerifier();
253
254
  const codeChallenge = generateCodeChallenge(codeVerifier);
254
255
 
256
+ // Build Cognito OAuth URL with PKCE - force Google account picker every time
257
+ const authUrl = `https://${COGNITO_DOMAIN}/oauth2/authorize?` +
258
+ `client_id=${CLIENT_ID}&` +
259
+ `response_type=code&` +
260
+ `scope=email+openid+profile&` +
261
+ `redirect_uri=http://localhost:${PORT}/callback&` +
262
+ `code_challenge=${codeChallenge}&` +
263
+ `code_challenge_method=S256&` +
264
+ `identity_provider=Google&` +
265
+ `prompt=select_account`;
266
+
255
267
  // Create local server to receive callback
256
268
  const server = http.createServer(async (req, res) => {
257
269
  const url = new URL(req.url, `http://localhost:${PORT}`);
258
270
 
271
+ // Root path - redirect to auth URL (for VS Code "Open in Browser" clicks)
272
+ if (url.pathname === '/') {
273
+ res.writeHead(302, { 'Location': authUrl });
274
+ res.end();
275
+ return;
276
+ }
277
+
259
278
  if (url.pathname === '/callback') {
260
279
  // Extract authorization code from query params
261
280
  const code = url.searchParams.get('code');