DoSomething / gateway

:lock_with_ink_pen: An opinionated PHP REST API client.
MIT License
2 stars 0 forks source link

Update OAuth exceptions to be more clear. #100

Closed DFurnes closed 6 years ago

DFurnes commented 6 years ago

What's this PR do?

This pull request update's Gateway's included OAuth exceptions to be more clear – they have more helpful error messages, powered by Laravel 5.5 renderable exceptions & the correct 401 status code, ensuring spec-compliant OAuth clients work out of the box!

How should this be reviewed?

I've tested this alongside my local Rogue, and updated the corresponding unit tests.

Checklist

DFurnes commented 6 years ago

Note: for apps that are not on Laravel 5.5 (just Phoenix Next, I believe) we can always catch these exceptions in the handler and call the exception's render method manually.