robsontenorio / laravel-keycloak-guard

🔑 Simple Keycloak Guard for Laravel
MIT License
434 stars 141 forks source link

Change the error message 500 for a wrong token #85

Closed palla451 closed 1 year ago

palla451 commented 1 year ago

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

robsontenorio commented 1 year ago

Are you able to send a PR?

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

palla451 commented 1 year ago

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