diff --git a/.changeset/make-http-exception-2.md b/.changeset/make-http-exception-2.md new file mode 100644 index 00000000..e949c929 --- /dev/null +++ b/.changeset/make-http-exception-2.md @@ -0,0 +1,5 @@ +--- +'@hono/firebase-auth': patch +--- + +fixed to make HTTPException instead of reponse null for bad request diff --git a/packages/firebase-auth/src/index.ts b/packages/firebase-auth/src/index.ts index c4b56503..04e9c2bd 100644 --- a/packages/firebase-auth/src/index.ts +++ b/packages/firebase-auth/src/index.ts @@ -39,9 +39,10 @@ export const verifyFirebaseAuth = (userConfig: VerifyFirebaseAuthConfig): Middle return async (c, next) => { const authorization = c.req.headers.get(config.AuthorizationHeaderKey) if (authorization === null) { - return new Response(null, { + const res = new Response('Bad Request', { status: 400, }) + throw new HTTPException(400, { res }) } const jwt = authorization.replace(/Bearer\s+/i, '') const auth = Auth.getOrInitialize(