Skip to content
Discussion options

You must be logged in to vote

Bouncer raises the AuthorizationException with E_AUTHORIZATION_FAILURE error code. You can simply capture this exception inside the global exception handler and return whatever you like from there.

Trimmed down version of Exception handler

handle(error, ctx) {
  if(error.code === 'E_AUTHORIZATION_FAILURE') {
    ctx.response.status(error.status).send({ message: error.message })
  }
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@3adel-bassiony
Comment options

Answer selected by 3adel-bassiony
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants