checkJWT express middleware crashes server on invalid token

Hello I am using the default auth0 jwt middleware for my nodeJs backend

export const checkJwt = auth({
    issuerBaseURL: process.env.ISSUER_BASE_URL,
    audience: process.env.AUTH0_AUDIENCE,
})

if a user makes an unauthorized request it crashes the whole application.

how can i stop this from happening? (i’m kind of new to express)

thanks in advance

Hi @blendaddict,

Are you seeing error codes? Messages? How are you handling the failed request?