Skip to content

Commit 9a95462

Browse files
committed
checking the did type
1 parent 01503af commit 9a95462

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"@atproto/common": "0.5.10",
4444
"@atproto/lex": "0.0.13",
4545
"@atproto/oauth-client-node": "^0.3.15",
46+
"@atproto/syntax": "0.4.3",
4647
"@deno/doc": "jsr:^0.189.1",
4748
"@floating-ui/vue": "1.1.10",
4849
"@iconify-json/carbon": "1.2.18",
@@ -75,7 +76,6 @@
7576
"defu": "6.1.4",
7677
"fast-npm-meta": "1.0.0",
7778
"focus-trap": "^7.8.0",
78-
"tinyglobby": "0.2.15",
7979
"marked": "17.0.1",
8080
"module-replacements": "2.11.0",
8181
"nuxt": "4.3.0",
@@ -88,6 +88,7 @@
8888
"simple-git": "3.30.0",
8989
"spdx-license-list": "6.11.0",
9090
"std-env": "3.10.0",
91+
"tinyglobby": "0.2.15",
9192
"ufo": "1.6.3",
9293
"unocss": "66.6.0",
9394
"unplugin-vue-router": "0.19.2",

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/api/auth/atproto.get.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ import { SLINGSHOT_HOST } from '#shared/utils/constants'
77
import { useServerSession } from '#server/utils/server-session'
88
import type { PublicUserSession } from '#shared/schemas/publicUserSession'
99
import { handleResolver } from '#server/utils/atproto/oauth'
10-
import { type AtIdentifierString, Client } from '@atproto/lex'
10+
import { Client } from '@atproto/lex'
1111
import * as app from '#shared/types/lexicons/app'
12+
import { ensureValidAtIdentifier } from '@atproto/syntax'
1213

1314
/**
1415
* Fetch the user's profile record to get their avatar blob reference
@@ -22,10 +23,10 @@ async function getAvatar(did: string, pds: string) {
2223
const pdsUrl = new URL(pds)
2324
// Only fetch from HTTPS PDS endpoints to prevent SSRF
2425
if (did && pdsUrl.protocol === 'https:') {
26+
ensureValidAtIdentifier(did)
2527
const client = new Client(pdsUrl)
2628
const profileResponse = await client.get(app.bsky.actor.profile, {
27-
// Hack for now need to find an example on how to use it properly
28-
repo: did as AtIdentifierString,
29+
repo: did,
2930
rkey: 'self',
3031
})
3132

0 commit comments

Comments
 (0)