A Laravel 8 application with Sanctum.
When I send a request to a defined route using Postman with an access token the response is correct. I'm happy with this.
When I send a request to a defined route using Postman without an access token the response is 401 Access denied. I'm happy with this.
When I send a request to an undefined route using Postman with an access token the response is 401 Unauthenticated. I'm NOT happy with this. I want a more appropriate response, such as 404.
I don't know how to choose what code from my application to include this question. Please ask me for whatever might be useful and I'll add it.
Update:
Thanks to the answer by @MartinZeitler I worked out that the problem is caused by me making Nova accessible at /
instead of /nova
.
I did this in /config/nova.php
by changing
'path' => '/nova',
to
'path' => '/',
.
If I revert this to '/nova'
then everything works as I expect it to.
But I need Nova at /
, so what can I do?