honojs / middleware

monorepo for Hono third-party middleware/helpers/wrappers
https://hono.dev
408 stars 141 forks source link

[firebase - auth] how i can change the message errors? #728

Open lucaspieran opened 1 week ago

lucaspieran commented 1 week ago

Hello! Is there any way to change the error messages when there is no header and when the token is not valid? Currently the messages are the following

{
    "message": "authorization header is empty"
}

and when its not valid

{
    "message": "failed to verify the requested firebase token: Error: Decoding Firebase ID token failed. Make sure you passed the entire string JWT which represents an ID token. See https://firebase.google.com/docs/auth/admin/verify-id-tokens for details on how to retrieve an ID token. err: Error: token must consist of 3 parts"
}
yusukebe commented 1 week ago

Hi @lucaspieran

@Code-Hex Can you answer this issue?