-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unauthorized error in /api/user #1
Comments
I faced same problem can you please provide any help on it. Thanks |
You need in the header, token authorization in Apis/Api.js Login.vue function
apis/Api.js
|
change your api middleware to web middleware in RouteServiceProvider in API routes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I have set up your example application according to the readme and when I log in using my credentials the request succeeds but the following request to
/api/user
ends with 401 Unauthorized with the{"message":"Unauthenticated."}
body.I have tried your example because I'm facing the same issue in my app where I try to use Sanctum.
Have you seen this issue before?
From what I found out when debugging the authentication process in Laravel I see that the session seems not to be initialized on the
/api/user
request, therefore Laravel doesn't find the session entry identified by the cookie sent with the request and fails with 401 Unauthorized.The text was updated successfully, but these errors were encountered: