Passport login not working in Laravel 10 and Passport 11 #47965
Unanswered
comprog-ux
asked this question in
General
Replies: 1 comment
-
As far as I know, this function no longer needs to be registered, when installing the library, routes are generated automatically, you can check this in Artisan |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In my project in Laravel 9 there are just a few parts responsible for user auth, these are a few:
app/Http/Controllers/Api/AuthenticateController.php
app/Providers/AuthServiceProvider.php
routes/api.php
These are responsible for user authorize.
This is the Laravel9 working system: http://shoot.mywire.org/
In AuthServiceProvider there is a line:
Passport::routes(null, ['prefix' => 'api/'.'v'.env('API_VERSION').'/oauth']);
that creates oauth_access_token and logs in the user in Laravel. 9
I have created a fresh system in Laravel 10 and copy all the important parts from the system 9 into that.
But I can't get the login to work.
When I comment out the line Passport::routes(null, ['prefix' => 'api/'.'v'.env('API_VERSION').'/oauth']); I'm getting the 404 NOT FOUND.
If I leave it in this happens:
Failed to load resource: the server responded with a status of 500 (Internal Server Error) and http://127.0.0.1:8001/api/v4.1.9/oauth/token in the browser console.
I can register users, change forgotten password and see list of competitions but not login.
I wonder if someone can lead me into the right path?
Beta Was this translation helpful? Give feedback.
All reactions