How to use Laravel Sanctum with two different frontend and backend domains?

1.4k Views Asked by At

Frontend: localhost:3002

Backend: sanctum.local

How to config these two fields in the env file:

SANCTUM_STATEFUL_DOMAINS=
SESSION_DOMAIN=

when I try to login I get 419 unknown status.

1

There are 1 best solutions below

0
On

add:

SANCTUM_STATEFUL_DOMAINS="localhost,127.0.0.1"
SESSION_DOMAIN=".sanctum.local"