Skip to content

Commit 766bfd0

Browse files
author
Frank
committed
wip: github actions
1 parent c7f30e1 commit 766bfd0

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/function/src/api.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,11 @@ export default {
230230
// get Authorization header
231231
const authHeader = request.headers.get("Authorization")
232232
const token = authHeader?.replace(/^Bearer /, "")
233-
if (!token) return new Response("Error: authorization header is required", { status: 401 })
233+
if (!token)
234+
return new Response(JSON.stringify({ error: "Authorization header is required" }), {
235+
status: 401,
236+
headers: { "Content-Type": "application/json" },
237+
})
234238

235239
// verify token
236240
const JWKS = createRemoteJWKSet(new URL(JWKS_URL))

0 commit comments

Comments
 (0)