Laravel12 Sanctum x Angular20 - Auth after refreshing does not work #170993
-
BodySo if i refresh my page which is secured by my auth-guard and checks if the user is logged in, i get is not logged in from my backend laravel Auth controller. I dont know where to ask this question so im doing it here if someone had the same or an issue like this. So if I press on the button after the login go to dashboard it does work and the user check does work: But if i try to edit the link from localhost:4200/login to locahost:4200 or refresh the page localhost:4200 it does not work and send me back to the login and it logs a complete new Session dump _token: I dont know what im doing wrong tbh - Every help appreciated! My files: login.ts AuthController: auth-guard.ts: import { Routes } from '@angular/router'; export const routes: Routes = [ ]; SESSION_DRIVER=cookie SESSION_SAME_SITE=lax 'paths' => ['api/*', 'sanctum/csrf-cookie', 'login', 'auth/current-user'], |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Problem was SSR lol - Just disabled it |
Beta Was this translation helpful? Give feedback.
Problem was SSR lol - Just disabled it