nightcode 1.0.3 → 1.0.5
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 +9 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1213,8 +1213,13 @@ function clearAuth() {
|
|
|
1213
1213
|
} catch {}
|
|
1214
1214
|
}
|
|
1215
1215
|
|
|
1216
|
+
// src/config.ts
|
|
1217
|
+
var API_URL = "https://nightcodeserver-production-865b.up.railway.app";
|
|
1218
|
+
var CLERK_FRONTEND_API = "https://known-civet-17.clerk.accounts.dev";
|
|
1219
|
+
var CLERK_OAUTH_CLIENT_ID = "XTe1bnAkoTK61DCg";
|
|
1220
|
+
|
|
1216
1221
|
// src/lib/api-client.ts
|
|
1217
|
-
var apiClient = hc(
|
|
1222
|
+
var apiClient = hc(API_URL, {
|
|
1218
1223
|
fetch: async (input, init) => {
|
|
1219
1224
|
const headers = new Headers(init?.headers);
|
|
1220
1225
|
const auth = getAuth();
|
|
@@ -1400,13 +1405,9 @@ function getErrorMessage2(error) {
|
|
|
1400
1405
|
return error instanceof Error ? error.message : String(error);
|
|
1401
1406
|
}
|
|
1402
1407
|
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");
|
|
1408
|
+
const clerkFrontendApi = CLERK_FRONTEND_API;
|
|
1409
|
+
const clientId = CLERK_OAUTH_CLIENT_ID;
|
|
1410
|
+
const apiUrl = API_URL;
|
|
1410
1411
|
const nonce = crypto.randomUUID();
|
|
1411
1412
|
const codeVerifier = toBase64Url(crypto.getRandomValues(new Uint8Array(32)));
|
|
1412
1413
|
const codeChallenge = await createPkceChallenge(codeVerifier);
|