I'm trying to get cookie with name XSRF_TOKEN when execute login function with laravel sanctum (breeze api) through "http://localhost:8000/sanctum/csrf-cookie" and nuxt 3, but I got undefinded value? What's step wrong from me?
...
const CSRF_COOKIE = ref("XSRF-TOKEN")
const CSRF_HEADER = ref("X-XSRF-TOKEN")
async function handleLogin() {
await useFetch('http://127.0.0.1:8000/sanctum/csrf-cookie', {
credentials: 'include'
});
const token = useCookie(CSRF_COOKIE.value);
console.log(token.value);
}
Token return undefinded value.