[READ-ONLY] Mirror of https://github.com/flo-bit/svelte-cloudflare-statusphere. statusphere.atmo.tools
atproto cloudflare-workers oauth svelte
0

Configure Feed

Select the types of activity you want to include in your feed.

update

+13 -7
+6 -5
scripts/generate-key.ts
··· 1 1 import { generateClientAssertionKey } from '@atcute/oauth-node-client'; 2 2 3 3 const key = await generateClientAssertionKey('main-key'); 4 + const json = JSON.stringify(key); 4 5 5 - console.log('Add this to your .dev.vars file:\n'); 6 - console.log(`CLIENT_ASSERTION_KEY=${JSON.stringify(JSON.stringify(key))}`); 7 - console.log('\nFor Cloudflare Workers, add it as a secret:'); 8 - console.log('npx wrangler secret put CLIENT_ASSERTION_KEY'); 9 - console.log('(paste the JSON value without the outer quotes)'); 6 + console.log('Generated client assertion key.\n'); 7 + console.log('Set it as a Cloudflare Workers secret:\n'); 8 + console.log(' npx wrangler secret put CLIENT_ASSERTION_KEY\n'); 9 + console.log('Then paste this value:\n'); 10 + console.log(json);
+3 -1
src/lib/atproto/settings.ts
··· 1 1 import { dev } from '$app/environment'; 2 2 3 - export const SITE = dev ? 'http://localhost:5183' : 'https://flo-bit.dev'; 3 + export const SITE = dev 4 + ? 'http://localhost:5183' 5 + : 'https://svelte-atproto-oauth-cloudflare-workers.flobit-dev.workers.dev/'; 4 6 5 7 type Permissions = { 6 8 collections: readonly string[];
+4 -1
src/lib/server/oauth.ts
··· 72 72 } 73 73 74 74 // In production, use confidential client with keyset 75 - const key: ClientAssertionPrivateJwk = JSON.parse(env!.CLIENT_ASSERTION_KEY); 75 + if (!env?.CLIENT_ASSERTION_KEY) { 76 + throw new Error('CLIENT_ASSERTION_KEY secret is not set. Run: pnpm generate-key && npx wrangler secret put CLIENT_ASSERTION_KEY'); 77 + } 78 + const key: ClientAssertionPrivateJwk = JSON.parse(env.CLIENT_ASSERTION_KEY); 76 79 const SITE = 'https://flo-bit.dev'; 77 80 78 81 return new OAuthClient({