Monorepo for wisp.place. A static site hosting service built on top of the AT Protocol. wisp.place

oauth scopes!!

Changed files
+8 -3
src
+2 -2
src/lib/oauth-client.ts
···
// Loopback client for local development
// For loopback, scopes and redirect_uri must be in client_id query string
const redirectUri = 'http://127.0.0.1:8000/api/auth/callback';
-
const scope = 'atproto transition:generic';
+
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=*';
const params = new URLSearchParams();
params.append('redirect_uri', redirectUri);
params.append('scope', scope);
···
application_type: 'web',
token_endpoint_auth_method: 'private_key_jwt',
token_endpoint_auth_signing_alg: "ES256",
-
scope: "atproto transition:generic",
+
scope: "atproto repo:place.wisp.fs repo:place.wisp.domain repo:place.wisp.subfs blob:accept=*/*&maxSize=100000000 rpc:app.bsky.actor.getProfile?aud=*",
dpop_bound_access_tokens: true,
jwks_uri: `${config.domain}/jwks.json`,
subject_type: 'public',
+6 -1
src/routes/user.ts
···
.get('/info', async ({ auth }) => {
try {
// Get user's handle from AT Protocol
-
const agent = new Agent((url, init) => auth.session.fetchHandler(url, init))
+
const agent = new Agent(auth.session)
let handle = 'unknown'
try {
+
console.log('[User] Attempting to fetch profile for DID:', auth.did)
const profile = await agent.getProfile({ actor: auth.did })
+
console.log('[User] Profile fetched successfully:', profile.data.handle)
handle = profile.data.handle
} catch (err) {
+
console.error('[User] Failed to fetch profile - Full error:', err)
+
console.error('[User] Error message:', err instanceof Error ? err.message : String(err))
+
console.error('[User] Error stack:', err instanceof Error ? err.stack : 'No stack')
logger.error('[User] Failed to fetch profile', err)
}