#I m using Laravel + React Inertia Starter Kit

6 messages · Page 1 of 1 (latest)

tulip geode
#

How are you hitting the end point? Seems like you have an API for this? Instead of a web route? You probably aren't sending the info via API request so Laravel can't resolve the user

P.S. I am guessing you are using an API since you return a json in your response, while Inertia can only handle Inertia responses

tulip geode
#

Read about spa authentication in laravel docs, you gotta send token with the request so the user can be resolved, also are you using sanctum?

hoary willow
#

I know about auth:sanctum and token way

#

You Mean if we create routes in web.php then Inertia handle
example:
$save->user_id = auth()->id()

tulip geode
#

But you cant just call an API without the credentials in request, read the documentation, it doesnt have to be token auth but cookie

tulip geode