@atproto/pds 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/index.js +14 -3
- package/dist/index.js.map +2 -2
- package/dist/lexicon/lexicons.d.ts +3 -0
- package/dist/lexicon/types/com/atproto/server/getSession.d.ts +1 -0
- package/package.json +5 -5
- package/src/api/com/atproto/server/getSession.ts +6 -1
- package/src/lexicon/lexicons.ts +3 -0
- package/src/lexicon/types/com/atproto/server/getSession.ts +1 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atproto/pds",
|
3
|
-
"version": "0.3.
|
3
|
+
"version": "0.3.2",
|
4
4
|
"license": "MIT",
|
5
5
|
"description": "Reference implementation of atproto Personal Data Server (PDS)",
|
6
6
|
"keywords": [
|
@@ -43,7 +43,7 @@
|
|
43
43
|
"typed-emitter": "^2.1.0",
|
44
44
|
"uint8arrays": "3.0.0",
|
45
45
|
"zod": "^3.21.4",
|
46
|
-
"@atproto/api": "^0.6.
|
46
|
+
"@atproto/api": "^0.6.23",
|
47
47
|
"@atproto/aws": "^0.1.4",
|
48
48
|
"@atproto/common": "^0.3.3",
|
49
49
|
"@atproto/crypto": "^0.2.3",
|
@@ -67,9 +67,9 @@
|
|
67
67
|
"@types/sharp": "^0.31.0",
|
68
68
|
"axios": "^0.27.2",
|
69
69
|
"ws": "^8.12.0",
|
70
|
-
"@atproto/api": "^0.6.
|
71
|
-
"@atproto/bsky": "^0.0.
|
72
|
-
"@atproto/dev-env": "^0.2.
|
70
|
+
"@atproto/api": "^0.6.23",
|
71
|
+
"@atproto/bsky": "^0.0.14",
|
72
|
+
"@atproto/dev-env": "^0.2.14",
|
73
73
|
"@atproto/lex-cli": "^0.2.4"
|
74
74
|
},
|
75
75
|
"scripts": {
|
@@ -1,13 +1,17 @@
|
|
1
1
|
import { InvalidRequestError } from '@atproto/xrpc-server'
|
2
2
|
import AppContext from '../../../../context'
|
3
3
|
import { Server } from '../../../../lexicon'
|
4
|
+
import { didDocForSession } from './util'
|
4
5
|
|
5
6
|
export default function (server: Server, ctx: AppContext) {
|
6
7
|
server.com.atproto.server.getSession({
|
7
8
|
auth: ctx.authVerifier.access,
|
8
9
|
handler: async ({ auth }) => {
|
9
10
|
const did = auth.credentials.did
|
10
|
-
const user = await
|
11
|
+
const [user, didDoc] = await Promise.all([
|
12
|
+
ctx.services.account(ctx.db).getAccount(did),
|
13
|
+
didDocForSession(ctx, did),
|
14
|
+
])
|
11
15
|
if (!user) {
|
12
16
|
throw new InvalidRequestError(
|
13
17
|
`Could not find user info for account: ${did}`,
|
@@ -18,6 +22,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
18
22
|
body: {
|
19
23
|
handle: user.handle,
|
20
24
|
did: user.did,
|
25
|
+
didDoc,
|
21
26
|
email: user.email,
|
22
27
|
emailConfirmed: !!user.emailConfirmedAt,
|
23
28
|
},
|
package/src/lexicon/lexicons.ts
CHANGED