Skip to content

Unauthorized error in /api/user #1

@KKSzymanowski

Description

@KKSzymanowski

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions