[READ-ONLY] Mirror of https://github.com/flo-bit/contrail. atproto backend in a bottle flo-bit.dev/contrail/
0

Configure Feed

Select the types of activity you want to include in your feed.

fix: surface AuthError description in spaces auth middleware

verifier.verify returns a structured {error, description} AuthError on
failure, but the middleware stringified it as `String(result.error)`,
producing "[object Object]" in the 401 body. Real rejection reasons
("jwt lexicon method does not match", "invalid signature",
"could not resolve did document", etc.) were invisible to callers.

Surface the description (or the error name as fallback) so 401 bodies
carry a human-readable reason.

Tom Scanlan (Apr 24, 2026, 7:02 PM EDT) ca8a7b36 4ef9cf70

+8 -1
+8 -1
packages/contrail/src/core/spaces/auth.ts
··· 73 73 74 74 const result = await verifier.verify(token, { lxm }); 75 75 if (!result.ok) { 76 - return c.json({ error: "AuthRequired", message: String(result.error) }, 401); 76 + const err = result.error as { error?: string; description?: string } | undefined; 77 + return c.json( 78 + { 79 + error: "AuthRequired", 80 + message: err?.description ?? err?.error ?? String(result.error), 81 + }, 82 + 401, 83 + ); 77 84 } 78 85 79 86 c.set("serviceAuth", {