vibecodingmachine-cli 1.0.7 → 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 +18 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibecodingmachine-cli",
3
- "version": "1.0.7",
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
@@ -253,10 +253,28 @@ class CLIAuth {
253
253
  const codeVerifier = generateCodeVerifier();
254
254
  const codeChallenge = generateCodeChallenge(codeVerifier);
255
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
+
256
267
  // Create local server to receive callback
257
268
  const server = http.createServer(async (req, res) => {
258
269
  const url = new URL(req.url, `http://localhost:${PORT}`);
259
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
+
260
278
  if (url.pathname === '/callback') {
261
279
  // Extract authorization code from query params
262
280
  const code = url.searchParams.get('code');