#csrf token mismatch | using breeze

1 messages · Page 1 of 1 (latest)

tardy linden
#

maybe this can help

SANCTUM_STATEFUL_DOMAINS=localhost,localhost:3000,localhost:5173,127.0.0.1,127.0.0.1:8000,127.0.0.1:5173,::1
SESSION_DOMAIN=localhost
naive dew
#

yeah same

naive dew
#

i tried another sultion now it works for localhost: but not for 127.0.0.1:3000

#

damn

tardy linden
tardy linden
# naive dew i tried another sultion now it works for localhost: but not for 127.0.0.1:3000

try with this in your .env file

APP_URL=http://localhost:8000
FRONTEND_URL=http://localhost:3000
SANCTUM_STATEFUL_DOMAINS=localhost,localhost:3000,127.0.0.1:3000,127.0.0.1,127.0.0.1:8000,::1
SESSION_DOMAIN=localhost

check the cors.php file :'supports_credentials' => true

Are you using axios for the frontend?

if it yes

import axios from "axios";

axios.defaults.withCredentials = true;

const api = axios.create({
  baseURL: http://localhost:8000,
  withXSRFToken: true
})
naive dew
#

how to close this post

tardy linden