I have a project where I implemented Sanctum to be used as authentication for api calls. This is the way I use it
axios.get('/sanctum/csrf-cookie').then(response => {
axios.post('/api/login', {data: data})
.then(response => {
...
})
.catch(error => {
...
});
});
When I run this as a standalone page, everything works fine. But once I try to use the same url with the same data in an iframe within another project, I get a CSRF token mismatch.
error. Any guidance would be much appreciated.