@createlex/createlexgenai 1.0.1 → 1.0.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/login.js +3 -3
package/package.json
CHANGED
package/src/commands/login.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const http = require('http');
|
|
4
|
-
const
|
|
4
|
+
const { URL } = require('url');
|
|
5
5
|
const log = require('../utils/logger');
|
|
6
6
|
const authManager = require('../core/auth-manager');
|
|
7
7
|
const configStore = require('../core/config-store');
|
|
@@ -34,7 +34,7 @@ async function login() {
|
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
const parsedUrl =
|
|
37
|
+
const parsedUrl = new URL(req.url, 'http://localhost');
|
|
38
38
|
|
|
39
39
|
// POST /auth/success — same endpoint as VS Code extension & Bridge app
|
|
40
40
|
if (req.method === 'POST' && parsedUrl.pathname === '/auth/success') {
|
|
@@ -105,7 +105,7 @@ async function login() {
|
|
|
105
105
|
// Use same OAuth flow as VS Code extension: /login?redirect=bridge-callback&source=bridge
|
|
106
106
|
const frontendCallbackUrl = `${webBaseUrl}/bridge-callback`;
|
|
107
107
|
const loginUrl = new URL('/login', webBaseUrl);
|
|
108
|
-
loginUrl.searchParams.set('redirect',
|
|
108
|
+
loginUrl.searchParams.set('redirect', frontendCallbackUrl);
|
|
109
109
|
loginUrl.searchParams.set('source', 'bridge');
|
|
110
110
|
|
|
111
111
|
log.header('CreateLex Login');
|