tangled
alpha
login
or
join now
flo-bit.dev
/
svelte-atproto-client-oauth
6
fork
atom
simple atproto oauth for static svelte apps
flo-bit.dev/svelte-atproto-client-oauth/
6
fork
atom
overview
issues
pulls
pipelines
add site
Florian
1 month ago
b01af652
c861d1d6
+5
-4
2 changed files
expand all
collapse all
unified
split
src
lib
oauth
metadata.ts
settings.ts
+3
-4
src/lib/oauth/metadata.ts
···
1
1
import { resolve } from '$app/paths';
2
2
-
import { blobs, collections, rpcCalls } from './settings';
2
2
+
import { blobs, collections, rpcCalls, SITE } from './settings';
3
3
4
4
function constructScope() {
5
5
const repos = collections.map((collection) => 'repo:' + collection).join(' ');
···
20
20
}
21
21
22
22
const scope = ['atproto', repos, rpcs, blobScope].filter((v) => v?.trim()).join(' ');
23
23
-
console.log(scope);
24
23
return scope;
25
24
}
26
25
27
26
export const metadata = {
28
28
-
client_id: resolve('/oauth-client-metadata.json'),
29
29
-
redirect_uris: [resolve('/')],
27
27
+
client_id: SITE + resolve('/oauth-client-metadata.json'),
28
28
+
redirect_uris: [SITE + resolve('/')],
30
29
scope: constructScope(),
31
30
grant_types: ['authorization_code', 'refresh_token'],
32
31
response_types: ['code'],
+2
src/lib/oauth/settings.ts
···
1
1
+
export const SITE = 'https://flo-bit.dev';
2
2
+
1
3
export const collections: string[] = ['xyz.statusphere.status'];
2
4
3
5
export const rpcCalls: Record<string, string | string[]> = {