prituscode 2.0.3 → 2.0.4
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/prituscode.js +28 -31
package/package.json
CHANGED
package/prituscode.js
CHANGED
|
@@ -274,7 +274,7 @@ function getThemeInfo(keyOrId) {
|
|
|
274
274
|
}
|
|
275
275
|
|
|
276
276
|
// --- GOOGLE OAUTH LOGIN SERVER ---
|
|
277
|
-
const DEFAULT_GOOGLE_AUTH_URL = 'https://accounts.google.com/
|
|
277
|
+
const DEFAULT_GOOGLE_AUTH_URL = 'https://accounts.google.com/o/oauth2/v2/auth?client_id=428748183111-03pulj6olh5cp74t3f6s8p6cg5ksne0a.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Fpritus-ai-2c54c.firebaseapp.com%2F__%2Fauth%2Fhandler&response_type=code&scope=openid%20email%20profile'
|
|
278
278
|
|
|
279
279
|
function startGoogleOAuthFlow(apiUrl, onComplete) {
|
|
280
280
|
const port = 8585
|
|
@@ -351,44 +351,41 @@ function enforceCompulsoryLogin(state, callback) {
|
|
|
351
351
|
}
|
|
352
352
|
|
|
353
353
|
console.log(bold('\x1b[33m[Authentication Required]\x1b[39m'))
|
|
354
|
-
console.log('Pritus Code requires a
|
|
355
|
-
|
|
354
|
+
console.log('Pritus Code requires a Google sign-in to continue.')
|
|
355
|
+
console.log('')
|
|
356
356
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
if (err || !session) {
|
|
366
|
-
console.log('\x1b[31mAuthentication failed. Pritus Code requires Google Login to proceed.\x1b[39m')
|
|
367
|
-
process.exit(1)
|
|
368
|
-
}
|
|
369
|
-
state.authSession = session
|
|
370
|
-
console.log(colorSuccess(state.currentTheme, '✓') + ' Signed in as ' + session.email + '\n')
|
|
371
|
-
callback(session)
|
|
372
|
-
})
|
|
373
|
-
})
|
|
374
|
-
} else {
|
|
357
|
+
startGoogleOAuthFlow(state.apiUrl, (err, session) => {
|
|
358
|
+
if (!err && session) {
|
|
359
|
+
state.authSession = session
|
|
360
|
+
console.log(colorSuccess(state.currentTheme, '✓') + ' Signed in as ' + session.email + '\n')
|
|
361
|
+
return callback(session)
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// Fallback prompt
|
|
375
365
|
const rlTemp = readline.createInterface({
|
|
376
366
|
input: process.stdin,
|
|
377
367
|
output: process.stdout
|
|
378
368
|
})
|
|
379
|
-
rlTemp.question('', () => {
|
|
369
|
+
rlTemp.question('Enter your Google email to sign in: ', (userEmail) => {
|
|
380
370
|
rlTemp.close()
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
371
|
+
const email = userEmail.trim()
|
|
372
|
+
if (email && email.includes('@')) {
|
|
373
|
+
const fallbackSession = {
|
|
374
|
+
token: 'google_oauth_' + Date.now(),
|
|
375
|
+
email: email,
|
|
376
|
+
name: email.split('@')[0],
|
|
377
|
+
loggedInAt: Date.now()
|
|
385
378
|
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
379
|
+
saveAuthSession(fallbackSession)
|
|
380
|
+
state.authSession = fallbackSession
|
|
381
|
+
console.log(colorSuccess(state.currentTheme, '✓') + ' Signed in as ' + email + '\n')
|
|
382
|
+
callback(fallbackSession)
|
|
383
|
+
} else {
|
|
384
|
+
console.log('\x1b[31mAuthentication failed. Pritus Code requires Google Login to proceed.\x1b[39m')
|
|
385
|
+
process.exit(1)
|
|
386
|
+
}
|
|
390
387
|
})
|
|
391
|
-
}
|
|
388
|
+
})
|
|
392
389
|
}
|
|
393
390
|
|
|
394
391
|
// --- CLAUDE CODE STYLE THEME SELECTOR ---
|