simple atproto oauth for static svelte apps flo-bit.dev/svelte-atproto-client-oauth/

add site

Florian b01af652 c861d1d6

+5 -4
+3 -4
src/lib/oauth/metadata.ts
··· 1 import { resolve } from '$app/paths'; 2 - import { blobs, collections, rpcCalls } from './settings'; 3 4 function constructScope() { 5 const repos = collections.map((collection) => 'repo:' + collection).join(' '); ··· 20 } 21 22 const scope = ['atproto', repos, rpcs, blobScope].filter((v) => v?.trim()).join(' '); 23 - console.log(scope); 24 return scope; 25 } 26 27 export const metadata = { 28 - client_id: resolve('/oauth-client-metadata.json'), 29 - redirect_uris: [resolve('/')], 30 scope: constructScope(), 31 grant_types: ['authorization_code', 'refresh_token'], 32 response_types: ['code'],
··· 1 import { resolve } from '$app/paths'; 2 + import { blobs, collections, rpcCalls, SITE } from './settings'; 3 4 function constructScope() { 5 const repos = collections.map((collection) => 'repo:' + collection).join(' '); ··· 20 } 21 22 const scope = ['atproto', repos, rpcs, blobScope].filter((v) => v?.trim()).join(' '); 23 return scope; 24 } 25 26 export const metadata = { 27 + client_id: SITE + resolve('/oauth-client-metadata.json'), 28 + redirect_uris: [SITE + resolve('/')], 29 scope: constructScope(), 30 grant_types: ['authorization_code', 'refresh_token'], 31 response_types: ['code'],
+2
src/lib/oauth/settings.ts
··· 1 export const collections: string[] = ['xyz.statusphere.status']; 2 3 export const rpcCalls: Record<string, string | string[]> = {
··· 1 + export const SITE = 'https://flo-bit.dev'; 2 + 3 export const collections: string[] = ['xyz.statusphere.status']; 4 5 export const rpcCalls: Record<string, string | string[]> = {