Questions tagged [laravel-sanctum]

Laravel is an innovative PHP web framework that enables developers to build dynamic and scalable web applications. Available as open-source, the source code for Laravel can be found on GitHub and is distributed under the MIT license.

Encountering authentication issues with REST API in React

I'm currently working on a project that involves using Laravel 9 for the backend and React for the frontend. Whenever I attempt to make a request, it returns an unauthorized error from the backend. However, when I test this in Postman, it returns a su ...

The integration of Laravel (Homestead) Sanctum is malfunctioning when combined with a standalone Vue application

After running the command php artisan serve my Laravel application successfully resolves on localhost:8000. I have configured Laravel Sanctum as follows: SESSION_DRIVER=cookie SESSION_DOMAIN=localhost SANCTUM_STATEFUL_DOMAINS=localhost:8080 As for m ...

Chorme is throwing a CSRF token mismatch error when working with Laravel API Sanctum

Having an issue with my Vue app and backend Laravel setup. I am using SPA Authentication for authentication. Everything works fine in localhost, but when I deployed it to the server, there are some issues. After sending a login request to sanctum/csrf-co ...

Having trouble with Laravel Sanctum CSRF and NextJs 14 integration

Currently, I am facing a challenge with communication between my Laravel server and Next.js frontend. An error 419 related to CSRF is encountered when sending requests like login requests. I want to highlight that tests were carried out on the same Larave ...

Is Laravel sanctum token persisting even after being removed in certain routes on a live server?

I've encountered an issue with Laravel Sanctum while creating an API. It works perfectly fine on localhost, but when I deploy it to a live server, the following problem arises: When accessing routes under middleware like this: Route::group(['middlewar ...

Unable to verify identity using spa

My API is running on the URL: https://example.com, and my vue.js app is running on: https://app.example.com. I have configured the .env file as follows: SESSION_DOMAIN=.example.com SANCTUM_STATEFUL_DOMAINS=https://app.example.com The axios configuration i ...