Questions tagged [sanctum]
65 questions
1
vote
0 answers
Sanctum is not working with subdomains in multi-tenant [Tenancy for Laravel]
I am using Tenancy for Laravel but failing to use sanctum on subdomains as I have to define SESSION_DOMAIN and SANCTUM_STATEFUL_DOMAINS wildcard or related to the Main domain.
Anyone can help me out.

Md Eshan
- 11
- 1
- 3
1
vote
0 answers
Laravel Sanctum: (Frontend & Backend with different IP Address) Error: Login CSRF Token mismatch
Having CSRF token mismatch error in login with Nuxt and Laravel Sanctum.
But when I change the URL of both apps (frontend & backend) into localhost, the login works perfectly.
But if I…

Enis Del Mar
- 31
- 3
1
vote
0 answers
Artisan publish Sanctum without a migration file
Sanctum Version: 2.15
Laravel Version: 9.11
PHP Version: 8.0.2
Database Driver & Version: mysql
Description:
I publish Sanctum did not generate the configuration
Steps To Reproduce:
The Laravel Sail development environment was used
into the…

wuyabai
- 11
- 1
1
vote
0 answers
Sanctum not working with subdomain SPA with vue3
i am using sanctum with multiple subdomain dynamically created on user creation but when I am using test.localhost/project_name subdomain sanctum auth not working but when i am using localhost/project_name its working fine. i have…

Umer farooq
- 11
- 3
1
vote
0 answers
Laravel SPA (laravel + vuejs + sanctum) deployed in subdomain returns wrong api
I have this problem since several days.
I'm developing a Vuejs/laravel app, using Sanctum as an authenticator. where laravel mainly have the api gestion role, and I've started to deploying it. On Local, everything looks fine, api and auth are…

Moonatic89
- 11
- 2
1
vote
0 answers
How to protect Dashboard page from unauthenticated user in an SPA with Laravel and Vuejs
When a user logs in I'm storing the status in local storage as shown below using and they get redirected to their dashboard. The dashboard is viewable when we have authenticated = 'true' in the local storage. That works well but now anyone who…

Alphy Gacheru
- 489
- 1
- 9
- 28
1
vote
2 answers
Laravel Sanctum multiple guard/middleware
I am using Laravel Sanctum and Vuejs. I want to login as administrator and user separately, and of course their requests shouldn't reach each other.
I have user (model and controller) and admin (model and controller)
this is how i log in (both…

mehmetakkus
- 631
- 1
- 8
- 25
1
vote
1 answer
419 Page Expired with Laravel Octane, Sail, Sanctum and Dusk
After migration to Laravel Octane, the dusk tests fails with 419 Page Expired. Before the migration, everything was fine...
I made the following change to the name file docker/8.1/supervisord.conf
-command=/usr/bin/php -d variables_order=EGPCS…

martio
- 121
- 1
- 5
0
votes
0 answers
Laravel session id changes in every request
I am developing a mobile application with Cordova. I am writing the backend with laravel 10. I am using laravel sanctum for the token. I have written the login and user information retrieval api tips. I am testing the api tips in Postman. After…

alp
- 11
- 1
0
votes
0 answers
Laravel/Sanctum CSRF key documentation and GET / POST / PATCH behaviour
I'm using postman to test the API i'm building in Laravel 10. Auth via Sanctum.
The weird thing is, in the documentation:
In addition, since your application already made a request to the /sanctum/csrf-cookie route, subsequent requests should…

onemorecoffee
- 1
- 1
0
votes
1 answer
example code / library to login / access (php / laravel) sanctum interface
I have got a sanctum interface in php / laravel:
The routes are:
Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
return $request->user();
});
Route::middleware('auth:sanctum')->prefix('v1')->group(function() {
…

LeifSec
- 65
- 8
0
votes
0 answers
Laravel Sanctum: Shifting user credentials - after some time the user logged in is now another user
When we do some user testing on our web app after some testing the user logged in shifts from the original to another one the other user does not have access to.
We checked the authentication part and our lead developer said this:
"The issue is not…

pockyroko
- 1
- 1
0
votes
5 answers
Laravel - Postman give me 200 code without content
I have login metod in Laravel api. When I try to send request i have code 200 without content in Postman
AuthController.php

MISIU
- 19
- 5
0
votes
0 answers
I am using Swoole to start a web service and using Sanctum for authentication in Laravel 7
Sanctum Version
2.15.1
Laravel Version
7
PHP Version
7.4
Description
I am using Swoole to start a web service and using Sanctum for authentication in Laravel 7. However, there is an issue: after successfully logging out, the token table in the…

2020s
- 1
- 1
0
votes
1 answer
Laravel + React using Sanctum for authentication how to access and refresh token
My concern is creating refresh token API and executing that endpoint on each and every request.
Isn't that extra request for application. Is this the right way to do ?
Is there any better solution for bearer token expiry for Single page application.

John Thapa
- 1
- 2