D
D
Dmitry Shelygin2020-04-13 20:32:45
Laravel
Dmitry Shelygin, 2020-04-13 20:32:45

How to configure auth:api middleware in Laravel Passport?

Laravel Passport connected.
If you make a request on the route with without passing the token, then the answer comes like thismiddleware('auth:api')

{
    "message": "Unauthenticated."
}


I would like to customize the response in the absence of a token, or an incorrect token.
There is no such middleware registered in app/Http/Kernel.php.
What to do?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question