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.
- package/package.json +1 -1
- package/src/utils/auth.js +18 -0
package/package.json
CHANGED
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');
|