your personal website on atproto - mirror
0
fork

Configure Feed

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

redirect to own page on sign in

Florian 28458118 3fedf086

+16 -3
+2 -2
src/lib/atproto/auth.svelte.ts
··· 40 40 41 41 const clientId = dev 42 42 ? `http://localhost` + 43 - `?redirect_uri=${encodeURIComponent('http://127.0.0.1:5179')}` + 43 + `?redirect_uri=${encodeURIComponent('http://127.0.0.1:5179/oauth/callback')}` + 44 44 `&scope=${encodeURIComponent(metadata.scope)}` 45 45 : metadata.client_id; 46 46 ··· 54 54 configureOAuth({ 55 55 metadata: { 56 56 client_id: clientId, 57 - redirect_uri: `${dev ? 'http://127.0.0.1:5179' : metadata.redirect_uris[0]}` 57 + redirect_uri: dev ? 'http://127.0.0.1:5179/oauth/callback' : metadata.redirect_uris[0] 58 58 }, 59 59 identityResolver: new LocalActorResolver({ 60 60 handleResolver: handleResolver,
+1 -1
src/lib/atproto/metadata.ts
··· 25 25 26 26 export const metadata = { 27 27 client_id: SITE + resolve('/oauth-client-metadata.json'), 28 - redirect_uris: [SITE + resolve('/')], 28 + redirect_uris: [SITE + resolve('/oauth/callback')], 29 29 scope: constructScope(), 30 30 grant_types: ['authorization_code', 'refresh_token'], 31 31 response_types: ['code'],
+13
src/routes/(auth)/oauth/callback/+page.svelte
··· 1 + <script lang="ts"> 2 + import { goto } from '$app/navigation'; 3 + import { user } from '$lib/atproto'; 4 + 5 + $effect(() => { 6 + console.log('hello', user); 7 + if (user.profile) { 8 + goto('/' + user.profile.handle + '/edit', {}); 9 + } 10 + }); 11 + </script> 12 + 13 + <div class="flex min-h-screen w-full items-center justify-center text-3xl">Loading...</div>
src/routes/oauth-client-metadata.json/+server.ts src/routes/(auth)/oauth-client-metadata.json/+server.ts