Skip to main content
Filter by
Sorted by
Tagged with
-1 votes
0 answers
87 views

I have a route which I wish to protect with a token, using Sanctum. The offending route is /status, which would be accessed by /api/status. The /foo route works fine, there is only a problem when ...
Kevin Waterson's user avatar
0 votes
1 answer
116 views

I’m running a Laravel backend alongside a Vue frontend on NGINX. The issue I’m facing is that my API endpoints are returning HTML instead of JSON. For example: https://isuecampusmap.site/api/ → ...
Bunz's user avatar
  • 1
Advice
0 votes
0 replies
48 views

I'm building an HR Management System using: Backend: Laravel Frontend: Next.js Authentication(SPA): Laravel Breeze (already set up for backend) I'm a beginner in Next.js, and I’m a bit stuck on how ...
Shashi Kelum's user avatar
3 votes
1 answer
135 views

I'm using Laravel 11 with Jetstream (Inertia + React) and Sanctum for authentication. Everything works fine when logging in via the default Inertia login page, but when I try to call a protected API ...
 NrzAmirHo3in's user avatar
1 vote
1 answer
105 views

Frontend part kept popping 401 Unauthorized, so I switched to Postman to just test the API. Just to mention I am using Sanctum for API auth. It keeps throwing 401 error, but Register route is not ...
G M's user avatar
  • 11
2 votes
1 answer
254 views

How do I fix the standard behavior of laravel sanctum. I use sanctum for a SPA application. I'm only interested in the backend component of the framework, without the blade pages. Route::get('/...
anim3x's user avatar
  • 21
4 votes
1 answer
631 views

I created an app using Laravel 12 + Sanctum and React. Locally in my laptop my app is working properly then I upload it to a Windows Server (IIS). With the same port 5173 of React and port 82 for the ...
IreneT's user avatar
  • 49
0 votes
1 answer
117 views

I have an SPA in Laravel 12 using vue and Sanctum for auth. I want to create a middleware to protect the the api routes /api/admin/* I have created a middleware Admin.php public function handle(...
calin24's user avatar
  • 1,021
0 votes
0 answers
82 views

I am using Laravel sanctum SPA authentication and everytime I use axios with config of withCredentials:true and withXSRFToken:true and call protected routes from the laravel api, it works perfectly ...
Jems's user avatar
  • 1
0 votes
1 answer
94 views

I am building a website using React for the frontend and Laravel for the backend. I wrote a React Context for authentication, which sends a request to the /api/user endpoint. This endpoint is ...
mohammad abd elhady's user avatar
3 votes
2 answers
241 views

Here's the situation I'm facing in my project: Stack: Backend: Laravel 12 (session driver: database, Sanctum SPA authentication) Frontend: Nuxt 3 Backend runs at: localhost:8000 Frontend runs at: ...
Accio's user avatar
  • 31
0 votes
1 answer
224 views

I am using Laravel sanctum SPA auth to protect my routes/api.php routes. Instead of manually implementing the routes and controllers for authentication, I am using Laravel Fortify. Now Fortify adds ...
Nelize du Toit's user avatar
1 vote
1 answer
212 views

I'd like to implement authentication in Laravel 11/12. I am using Laravel as an API that is consumed by two Angular SPA's on the same domain (different subdomains): call it the admin frontend and the ...
Nelize du Toit's user avatar
0 votes
0 answers
42 views

I'm trying to make a Laravel project (v 12) to serve 3 subdomains with completely separated authentication systems (Separated users model, users table, sessions table, etc.) using Laravel Sanctum. ...
Mehdi Maazi's user avatar
0 votes
2 answers
108 views

I have a Laravel REST API that exclusively serves authenticated users. Authentication is done via Laravel Sanctum. Now for local development on the API, I seed the database with three users. User::...
lchristmann's user avatar
2 votes
2 answers
289 views

Using Laravel Sanctum it seems tedious, that I must always explicitly delete the personal access tokens, when deleting a user: $user = User::find(123); $user->tokens()->delete(); // ...
lchristmann's user avatar
1 vote
1 answer
179 views

I am trying to build authenticatio for my React SPA using Laravel Sanctum SPA, the problem is whenever I try to send a login request I keep getting "CSRF token mismatch", despite following ...
mohammad abd elhady's user avatar
0 votes
2 answers
186 views

I'm building a frontend in React.js and a backend in Laravel, and I'm trying to implement authentication using Laravel Sanctum. I've set up the Laravel API, installed Sanctum, and configured the cors, ...
Umair Zubair's user avatar
0 votes
0 answers
34 views

I'm working on a Laravel 11 API using Sanctum for authentication. I have a route protected by the auth:sanctum middleware, and I'm sending a valid token in the request header. However, when I try to ...
Yerson Orejuela's user avatar
0 votes
2 answers
109 views

Does Sanctum (or Laravel) cookie-based session require me to have Laravel deployed to the root folder? Background My application lives in a monorepo with server, client and some other folders, with ...
dotNET's user avatar
  • 35.7k
0 votes
1 answer
121 views

With Laravel Sanctum, we have to set the SANCTUM_STATEFUL_DOMAINS environment variable to specify which domains should be treated as stateful—meaning they rely on sessions and cookies for ...
xerox0213's user avatar
1 vote
1 answer
151 views

I created an authentication app using Laravel API Sanctum and React.js. Now when the user is logged In the token is sent from the API with an expiration duration of 30 minutes. There are two cases ...
Adil Akothiat's user avatar
-1 votes
1 answer
172 views

I'm trying to implement Sanctum authentification between laravel 11 and Angular 18 but to no eval, i tried everything i could find on forums , tutorials , chatgpt but nothing worked , this website is ...
Youssera Zoukha MECIFI's user avatar
0 votes
1 answer
154 views

We're trying to implement Sanctum SPA authentication (session based, not api tokens), when a user changes their password, we can't seem to log them out of other devices using Auth::logoutOtherDevices($...
Wonka's user avatar
  • 8,754
3 votes
0 answers
184 views

Issue I'm building a SPA that needs to authenticate with a Laravel back-end using Sanctum. I'm using the stancl/tenancy package for multi-tenancy, where each tenant has their own subdomain. However, ...
oghenemavo's user avatar
0 votes
0 answers
124 views

I am working with Laravel 11, and I'm using Sanctum for API authentication. However, I am encountering the error: Method Illuminate\Auth\RequestGuard::viaRemember does not exist. This error occurs ...
Ali Zain's user avatar
0 votes
0 answers
120 views

I've started project with Laravel and Nuxt3. But I can't use nuxt-auth-utils with sanctum. It doesn't work. I try login, laravel return token then it processes another request - https://ecommerce.loc:...
Andrey's user avatar
  • 11
1 vote
0 answers
92 views

I'm developing an Api with Laravel 11 using Sanctum as the authentication method. I've set the token expiration to 7 days and I'd like the client to receive a 401 response 'Token invalid or expired' ...
MigSy's user avatar
  • 11
0 votes
1 answer
139 views

I have two laravel projects Bac4 laravel v.8 InfraProject laravel v.9 I want them to communicate using the Laravel Sanctum API. I want the InfraProject to access some data in the Bac4 project and ...
Rex Zednelab's user avatar
0 votes
1 answer
101 views

I have Laravel as the backend and Nuxt js as frontend i used Session Sanctum here is the set up: in my cors.php : 'paths' => ['api/*', 'sanctum/csrf-cookie'], 'allowed_methods' => ['*'], ...
rabie ali's user avatar
0 votes
1 answer
330 views

I'm using Laravel Jetstream, which uses sanctum for authentication. I'm trying to build a simple impersonate feature, and I have it working 99% of the way, but I am missing something small. If the ...
Todd Horst's user avatar
0 votes
1 answer
97 views

I tried using token based auth using Laravel Sanctum, using Nuxt JS on Front End Laravel Framework 11.29.0 (http://192.168.10.11:8000) Nuxt 3.13.2 running in (http://192.168.10.11:3000) And ...
atma's user avatar
  • 214
0 votes
0 answers
66 views

I'm trying to make an authentication login with laravel Sanctum and get create the token using SQL Server and I have the following error: SQLSTATE[22007]: [Microsoft][ODBC Driver 17 for SQL Server][...
Edinho Rodrigues's user avatar
0 votes
1 answer
334 views

I have written an authentication form, login, registration and receipt of the user work for me, but logout does not work for me, the user can log into the account, but he can no longer log out. So ...
arisha's user avatar
  • 11
1 vote
2 answers
576 views

I'm building an API-only SPA with Laravel Sanctum and Nuxt3, using cookie-based session authentication. I’ve implemented Google OAuth using Laravel Socialite. Here’s my current setup for the Google ...
henrbu's user avatar
  • 208
0 votes
0 answers
64 views

When I access my Laravel sanctum API with Postman, it works properly. This is the code of routes\api.php: use App\Http\Controllers\PoiController; use App\Http\Controllers\AuthController; use ...
mas budi's user avatar
1 vote
1 answer
446 views

I have Laravel reverb private channel and when try to listen data not return also when make it as public channel data returned successfully: In my event I make broadcast with static data but not ...
Eslam Elbadry's user avatar
0 votes
1 answer
77 views

Sorry for my lack of CSRF understanding, but shouldnt this Sanctum feature make it pretty hard to access my endpoints from other than my frontend app? Everything is working in my frontend (SPA), ...
AP87's user avatar
  • 541
0 votes
0 answers
149 views

This error happens very often for people, most of the time because SANCTUM_STATEFUL_DOMAINS is not set correctly. I did set it correctly for local development but the error happens during testing, e.g....
Tim's user avatar
  • 963
4 votes
1 answer
533 views

Just because my understanding of the sanctum package seems to be wrong in some places: 1) I thought by reading the config of sanctum it will use the default /* |----------------------------------------...
gamedev's user avatar
  • 105
0 votes
0 answers
249 views

(I have been digging this for over 24 hours now and have tried everything that I could find online), so there is a lot of detail, but I'll try to keep it as objective as I can). I'm trying to access ...
dotNET's user avatar
  • 35.7k
0 votes
1 answer
73 views

When I log out with auth:sanctum middleware , the user_id field on sessions tabel is not set to null, unlike when I don't use it. Route::post('/logout', function (Request $request) { Auth::guard('...
none's user avatar
  • 101
2 votes
0 answers
102 views

I have two platforms: one built with pure PHP and session-based authentication, and the other using Laravel 11 and Vue 3. We have the authentication logic implemented on the first platform, and I'm ...
Ahmed Alaa ElDin's user avatar
1 vote
0 answers
135 views

I want to use Next.js application as SPA in an integrated way with Laravel API. There is breeze-next library for this, but the operations performed here are client-side. I want to do auth operations ...
Ubeydullah Yılmaz's user avatar
0 votes
1 answer
127 views

public function callback() { $googleUser = Socialite::driver('google')->user(); $user = User::updateOrCreate( ['google_id' => $googleUser->id], ...
Vadim Yanyushkin's user avatar
0 votes
0 answers
107 views

I am using Laravel 10 backend with Angular 16 frontend I am getting a CORS error when making a unauthenticated call. I do not get this error when there is a valid token attached to the request. I also ...
Judy Dick's user avatar
0 votes
0 answers
316 views

I'm working on a Laravel 11 project where I'm using Laravel Sanctum for authentication in my SPA (Vuejs3). My setup includes a backend and a frontend hosted on different subdomains, and I'm running ...
user avatar
0 votes
1 answer
893 views

I'm building a template project for myself, and I've got Reverb and Echo working as intended with regular channels, but when using private channels, the /broadcasting/auth route returns a 401 ...
dannypas00's user avatar
2 votes
1 answer
486 views

I have two projects, Laravel 8 and Next.js. Everything works smoothly when I send a GET request, but I encounter an error when I send a POST request. I've attempted various solutions, but the issue ...
mohammadK developer's user avatar
0 votes
0 answers
39 views

I have a laravel function for login which creates a sanctum token once successful: public function attempt(Request $request) { $validated = $request->validate([ 'email' => ['required'...
goodnight sir's user avatar

1
2 3 4 5
14