I am building an API for mobile application using Password Grant Tokens. When user tries to login to the application, client sends a request for the access token.
It is possible that the user has not verified his account using the link sent to his email. I wish to add an additional condition to the query and provide error response accordingly. Currently, as Passport manages token part, I can't do it directly.
How can this be solved? How can I dive in the token request and send custom response if there are any issues with user account? And continue sending token otherwise.
Answer from a Laravel Contributor :
make your own oauth/token route and put it in an oauth.php file within /routes:
Make a CustomAccessTokenController.php
Ref link - https://github.com/laravel/passport/issues/225#issuecomment-271057428