nightcode 1.0.3 → 1.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/dist/index.js +10 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1378,6 +1378,13 @@ var ModelsDialogContent = ({
|
|
|
1378
1378
|
};
|
|
1379
1379
|
// src/lib/oauth.ts
|
|
1380
1380
|
import open from "open";
|
|
1381
|
+
|
|
1382
|
+
// src/config.ts
|
|
1383
|
+
var API_URL = "https://nightcodeserver-production-865b.up.railway.app";
|
|
1384
|
+
var CLERK_FRONTEND_API = "https://known-civet-17.clerk.accounts.dev";
|
|
1385
|
+
var CLERK_OAUTH_CLIENT_ID = "XTe1bnAkoTK61DCg";
|
|
1386
|
+
|
|
1387
|
+
// src/lib/oauth.ts
|
|
1381
1388
|
var LOGIN_TIMEOUT_MS = 5 * 60 * 1000;
|
|
1382
1389
|
function toBase64Url(input) {
|
|
1383
1390
|
return Buffer.from(input).toString("base64url");
|
|
@@ -1400,13 +1407,9 @@ function getErrorMessage2(error) {
|
|
|
1400
1407
|
return error instanceof Error ? error.message : String(error);
|
|
1401
1408
|
}
|
|
1402
1409
|
async function performLogin() {
|
|
1403
|
-
const clerkFrontendApi =
|
|
1404
|
-
const clientId =
|
|
1405
|
-
const apiUrl =
|
|
1406
|
-
if (!clerkFrontendApi)
|
|
1407
|
-
throw new Error("CLERK_FRONTEND_API not set");
|
|
1408
|
-
if (!clientId)
|
|
1409
|
-
throw new Error("CLERK_OAUTH_CLIENT_ID not set");
|
|
1410
|
+
const clerkFrontendApi = CLERK_FRONTEND_API;
|
|
1411
|
+
const clientId = CLERK_OAUTH_CLIENT_ID;
|
|
1412
|
+
const apiUrl = API_URL;
|
|
1410
1413
|
const nonce = crypto.randomUUID();
|
|
1411
1414
|
const codeVerifier = toBase64Url(crypto.getRandomValues(new Uint8Array(32)));
|
|
1412
1415
|
const codeChallenge = await createPkceChallenge(codeVerifier);
|