We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c7f30e1 commit 766bfd0Copy full SHA for 766bfd0
1 file changed
packages/function/src/api.ts
@@ -230,7 +230,11 @@ export default {
230
// get Authorization header
231
const authHeader = request.headers.get("Authorization")
232
const token = authHeader?.replace(/^Bearer /, "")
233
- if (!token) return new Response("Error: authorization header is required", { status: 401 })
+ if (!token)
234
+ return new Response(JSON.stringify({ error: "Authorization header is required" }), {
235
+ status: 401,
236
+ headers: { "Content-Type": "application/json" },
237
+ })
238
239
// verify token
240
const JWKS = createRemoteJWKSet(new URL(JWKS_URL))
0 commit comments