File
Blob: src/worker/auth/cli-config.ts
| 1 | // Node-runnable copy of the auth config, used only by the Better Auth CLI |
| 2 | // (`auth generate`) to introspect plugins and emit the Drizzle |
| 3 | // schema. Not imported by the worker. |
| 4 | // |
| 5 | // Re-exporting `makeAuth(stubEnv)` so the CLI sees an `auth` instance with |
| 6 | // the same plugin set as production. The stub env never has its bindings |
| 7 | // dereferenced because the CLI only inspects the plugin tree. |
| 8 | |
| 9 | import { makeAuth } from "@/worker/auth"; |
| 10 | |
| 11 | const stubEnv = { |
| 12 | BETTER_AUTH_SECRET: "0".repeat(64), |
| 13 | BETTER_AUTH_URL: "https://auth.limic.dev", |
| 14 | OIDC_ISSUER: "https://auth.limic.dev", |
| 15 | GITHUB_OAUTH_CLIENT_ID: "", |
| 16 | GITHUB_OAUTH_CLIENT_SECRET: "", |
| 17 | GOOGLE_OAUTH_CLIENT_ID: "", |
| 18 | GOOGLE_OAUTH_CLIENT_SECRET: "", |
| 19 | TURNSTILE_SITE_KEY: "", |
| 20 | TURNSTILE_SECRET_KEY: "", |
| 21 | BOOTSTRAP_ADMIN_EMAIL: "", |
| 22 | DB: undefined as unknown as D1Database, |
| 23 | RL_AUTH: undefined as unknown as RateLimit, |
| 24 | RL_API: undefined as unknown as RateLimit, |
| 25 | ASSETS: undefined as unknown as Fetcher, |
| 26 | } as unknown as Env; |
| 27 | |
| 28 | export const auth = makeAuth(stubEnv, { |
| 29 | baseURL: "https://auth.limic.dev", |
| 30 | issuer: "https://auth.limic.dev", |
| 31 | }); |