From 39a134bb8fa5425a74bd1e4c82a5d9cede332fc6 Mon Sep 17 00:00:00 2001 From: Alexander Niebuhr Date: Thu, 3 Jul 2025 09:40:53 +0200 Subject: [PATCH] stash --- astro.config.mjs | 26 +++++++++++++++++--------- src/lib/auth.ts | 1 + 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index 34428e1..e39cd1e 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -91,13 +91,21 @@ export default defineConfig({ }, }, }), - // env: { - // validateSecrets: true, - // schema: { - // BETTER_AUTH_SECRET: envField.string({ - // context: "server", - // access: "secret", - // }) - // } - // } + env: { + validateSecrets: true, + schema: { + BETTER_AUTH_SECRET: envField.string({ + context: "server", + access: "secret", + }), + GITHUB_CLIENT_SECRET: envField.string({ + context: "server", + access: "secret", + }), + GITHUB_CLIENT_ID: envField.string({ + context: "server", + access: "public", + }) + } + } }); diff --git a/src/lib/auth.ts b/src/lib/auth.ts index 9bd0c8b..76e1255 100644 --- a/src/lib/auth.ts +++ b/src/lib/auth.ts @@ -1,6 +1,7 @@ import { betterAuth } from 'better-auth'; import { admin, oAuthProxy } from 'better-auth/plugins'; import { D1Dialect } from 'kysely-d1'; +import { BETTER_AUTH_SECRET } from 'astro:env/server'; export const auth = (url: string, env: Env) => { return betterAuth({