robsontenorio/laravel-keycloak-guard

Change the error message 500 for a wrong token

palla451 opened this issue · 2 comments

If I enter the token incorrectly I get an error message [Guard Token] etc.... and the call goes into error 500. But this in the case of the frontend should receive a 401. Is there a way to fix this problem

Are you able to send a PR?

In any case you can “intercept” that error in your app the handle it.

Good morning,
how do I handle such a generic error with code 500 that can show up for anything and having to send a 401 to the frontend, it doesn't make sense...bye bye