feat: create atproto oauth login

This commit is contained in:
Julien Calixte
2026-03-10 12:27:35 +01:00
parent 908641e54b
commit 8843d67a80
16 changed files with 485 additions and 7 deletions

View File

@@ -0,0 +1,24 @@
export const getFollows = async (did: string): Promise<Set<string>> => {
const follows = new Set<string>()
let cursor: string | undefined
do {
const url = new URL('https://public.api.bsky.app/xrpc/app.bsky.graph.getFollows')
url.searchParams.set('actor', did)
url.searchParams.set('limit', '100')
if (cursor) {
url.searchParams.set('cursor', cursor)
}
const response = await fetch(url)
const result: { follows: { did: string }[]; cursor?: string } = await response.json()
for (const follow of result.follows) {
follows.add(follow.did)
}
cursor = result.cursor
} while (cursor)
return follows
}