@unikode/cli 1.0.14 → 1.0.16
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 +6 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1609,6 +1609,7 @@ var ThemeDialogContent = () => {
|
|
|
1609
1609
|
};
|
|
1610
1610
|
// src/lib/oauth.ts
|
|
1611
1611
|
import open from "open";
|
|
1612
|
+
import os from "os";
|
|
1612
1613
|
var LOGIN_TIMEOUT_MS = 5 * 60 * 1000;
|
|
1613
1614
|
function toBase64Url(input) {
|
|
1614
1615
|
return Buffer.from(input).toString("base64url");
|
|
@@ -1631,8 +1632,8 @@ function getErrorMessage2(error) {
|
|
|
1631
1632
|
return error instanceof Error ? error.message : String(error);
|
|
1632
1633
|
}
|
|
1633
1634
|
async function performLogin() {
|
|
1634
|
-
const clerkFrontendApi =
|
|
1635
|
-
const clientId =
|
|
1635
|
+
const clerkFrontendApi = "https://leading-mule-30.clerk.accounts.dev";
|
|
1636
|
+
const clientId = "6puX06HhElJdiRhC";
|
|
1636
1637
|
const apiUrl = process.env.API_URL ?? "http://localhost:3000";
|
|
1637
1638
|
if (!clerkFrontendApi)
|
|
1638
1639
|
throw new Error("CLERK_FRONTEND_API not set");
|
|
@@ -1645,6 +1646,7 @@ async function performLogin() {
|
|
|
1645
1646
|
return new Promise((resolve, reject) => {
|
|
1646
1647
|
const server = Bun.serve({
|
|
1647
1648
|
port: 0,
|
|
1649
|
+
hostname: "0.0.0.0",
|
|
1648
1650
|
async fetch(req) {
|
|
1649
1651
|
const url = new URL(req.url);
|
|
1650
1652
|
if (url.pathname !== "/callback") {
|
|
@@ -1714,7 +1716,8 @@ async function performLogin() {
|
|
|
1714
1716
|
reject(new Error("Failed to start callback server"));
|
|
1715
1717
|
return;
|
|
1716
1718
|
}
|
|
1717
|
-
const
|
|
1719
|
+
const cliHost = os.hostname();
|
|
1720
|
+
const state = encodeState({ port, nonce, cliHost });
|
|
1718
1721
|
const redirectUri = `${apiUrl}/auth/callback`;
|
|
1719
1722
|
const authorizeUrl = new URL(`${clerkFrontendApi}/oauth/authorize`);
|
|
1720
1723
|
authorizeUrl.searchParams.set("response_type", "code");
|