+2
-2
src/lib/oauth-client.ts
+2
-2
src/lib/oauth-client.ts
···
110
110
// Loopback client for local development
111
111
// For loopback, scopes and redirect_uri must be in client_id query string
112
112
const redirectUri = 'http://127.0.0.1:8000/api/auth/callback';
113
-
const scope = 'atproto transition:generic';
113
+
const scope = 'atproto repo:place.wisp.fs repo:place.wisp.domain repo:place.wisp.subfs blob:*/* blob?maxSize=100000000 rpc:app.bsky.actor.getProfile?aud=*';
114
114
const params = new URLSearchParams();
115
115
params.append('redirect_uri', redirectUri);
116
116
params.append('scope', scope);
···
145
145
application_type: 'web',
146
146
token_endpoint_auth_method: 'private_key_jwt',
147
147
token_endpoint_auth_signing_alg: "ES256",
148
-
scope: "atproto transition:generic",
148
+
scope: "atproto repo:place.wisp.fs repo:place.wisp.domain repo:place.wisp.subfs blob:accept=*/*&maxSize=100000000 rpc:app.bsky.actor.getProfile?aud=*",
149
149
dpop_bound_access_tokens: true,
150
150
jwks_uri: `${config.domain}/jwks.json`,
151
151
subject_type: 'public',
+6
-1
src/routes/user.ts
+6
-1
src/routes/user.ts
···
41
41
.get('/info', async ({ auth }) => {
42
42
try {
43
43
// Get user's handle from AT Protocol
44
-
const agent = new Agent((url, init) => auth.session.fetchHandler(url, init))
44
+
const agent = new Agent(auth.session)
45
45
46
46
let handle = 'unknown'
47
47
try {
48
+
console.log('[User] Attempting to fetch profile for DID:', auth.did)
48
49
const profile = await agent.getProfile({ actor: auth.did })
50
+
console.log('[User] Profile fetched successfully:', profile.data.handle)
49
51
handle = profile.data.handle
50
52
} catch (err) {
53
+
console.error('[User] Failed to fetch profile - Full error:', err)
54
+
console.error('[User] Error message:', err instanceof Error ? err.message : String(err))
55
+
console.error('[User] Error stack:', err instanceof Error ? err.stack : 'No stack')
51
56
logger.error('[User] Failed to fetch profile', err)
52
57
}
53
58