Skip to content

Commit

Permalink
fix: better unhautorized/forbidden message
Browse files Browse the repository at this point in the history
  • Loading branch information
GiovanniCardamone committed Oct 3, 2021
1 parent 725068c commit 1bf5a88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@ export default fastifyPlugin<FastifyAutosecurityOptions>(
) {
// 401 nessuna autorizzazione fornita
reply.status(401)
throw new Error('No Authorization provided')
throw new Error('Unauthorized')
} else {
// 403 nessuna autorizzazione fornita passa la validazione
reply.status(403)
throw new Error('No Authorization passed')
throw new Error('Forbidden')
}
}
})
Expand Down

0 comments on commit 1bf5a88

Please sign in to comment.