diff --git a/src/lib/atproto/index.ts b/src/lib/atproto/index.ts index 60c2f8f..27b0ad5 100644 --- a/src/lib/atproto/index.ts +++ b/src/lib/atproto/index.ts @@ -2,13 +2,15 @@ import '@atcute/atproto'; import { createAtprotoAuth } from '@svelte-atproto/oauth/server'; import { cloudflareKV } from '@svelte-atproto/oauth/server/stores/cloudflare'; +import { building } from '$app/environment'; import { env } from '$env/dynamic/private'; import { contrail } from '$lib/contrail'; // To enable signup, add: signupPDS: 'https://your-pds.example/' export const atproto = createAtprotoAuth({ origin: env.ORIGIN, - cookieSecret: env.COOKIE_SECRET, + // Cloudflare runtime secrets are unavailable while SvelteKit analyses the build. + cookieSecret: env.COOKIE_SECRET || (building ? 'build-only-cookie-secret' : undefined), clientAssertionKey: env.CLIENT_ASSERTION_KEY, scope: 'atproto repo:social.popfeed.feed.review repo:social.popfeed.feed.comment repo:social.popfeed.feed.like repo:social.popfeed.feed.list repo:social.popfeed.feed.listItem blob:*/* ' +