@dubeyvishal/orbital-cli 1.4.9 → 1.5.9

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dubeyvishal/orbital-cli",
3
- "version": "1.4.9",
3
+ "version": "1.5.9",
4
4
  "description": "A fullstack CLI-based AI platform with chat mode, multi-tool agents, and agentic AI workflows. Includes GitHub login with device authorization, secure authentication, and modular client–server architecture for building intelligent automation tools.",
5
5
  "author": "Vishal Dubey",
6
6
  "license": "MIT",
@@ -8,7 +8,7 @@ const __dirname = path.dirname(__filename);
8
8
  // Load env from the server package root (server/.env) regardless of where the process is started.
9
9
  const serverEnvPath = path.resolve(__dirname, "../../.env");
10
10
 
11
- dotenv.config({ path: serverEnvPath });
11
+ dotenv.config({ path: serverEnvPath, quiet: true });
12
12
 
13
13
  // Note: The Gemini API key is stored in the OS credential manager via keytar.
14
14
  // CLI code will hydrate GOOGLE_GENERATIVE_AI_API_KEY from keytar when needed.
@@ -16,13 +16,16 @@ const CLIENT_ORIGIN = FRONTEND_URL;
16
16
 
17
17
  app.use(express.json());
18
18
 
19
- app.use(
20
- cors({
21
- origin: CLIENT_ORIGIN,
22
- methods: ["GET", "POST", "PUT", "DELETE"],
23
- credentials: true,
24
- })
25
- );
19
+ // Skip Express cors for /api/auth/* routes — better-auth handles its own CORS.
20
+ const corsMiddleware = cors({
21
+ origin: CLIENT_ORIGIN,
22
+ methods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
23
+ credentials: true,
24
+ });
25
+ app.use((req, res, next) => {
26
+ if (req.path.startsWith("/api/auth/")) return next();
27
+ corsMiddleware(req, res, next);
28
+ });
26
29
 
27
30
  app.all("/api/auth/*splat", toNodeHandler(auth));
28
31
 
@@ -3,7 +3,7 @@ import { betterAuth } from "better-auth";
3
3
  import { prismaAdapter } from "better-auth/adapters/prisma";
4
4
  import { deviceAuthorization } from "better-auth/plugins";
5
5
  import prisma from "./db.js";
6
- import { FRONTEND_URL } from "../config/api.js";
6
+ import { API_BASE, FRONTEND_URL } from "../config/api.js";
7
7
 
8
8
  const CLIENT_ORIGIN =
9
9
  process.env.CLIENT_ORIGIN ||
@@ -15,12 +15,11 @@ export const auth = betterAuth({
15
15
  provider: "postgresql",
16
16
  }),
17
17
 
18
- baseURL: CLIENT_ORIGIN,
18
+ baseURL: API_BASE,
19
19
  basePath: "/api/auth",
20
20
 
21
21
  trustedOrigins: [CLIENT_ORIGIN],
22
22
 
23
-
24
23
  cors: {
25
24
  origin: CLIENT_ORIGIN,
26
25
  credentials: true,