serkandyck / laravel-sanctum-vue-spa

A Laravel7-Sanctum-Vue SPA starter project template.
https://dry-cliffs-46064.herokuapp.com/
MIT License
28 stars 10 forks source link

419 (unknown status) #4

Open KitaXvost opened 4 years ago

KitaXvost commented 4 years ago

When sending the form in the console I get error 419

Tell me please how to fix it

Снимок экрана 2020-10-10 в 12 06 59

Tebra commented 4 years ago

I got the same error and in the network response there is this:

exception: "Symfony\Component\HttpKernel\Exception\HttpException"
file: "/home/rijad/dev/playground/laravel-sanctum-vue-spa/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php"
line: 226
message: "CSRF token mismatch."

Should something else be generated?

Tebra commented 4 years ago

I got it to work by editing the .env File:

SESSION_DOMAIN=localhost
SANCTUM_STATEFUL_DOMAINS=localhost

The requests are going trough now.

KitaXvost commented 4 years ago

I rewrote all the files that contain the outdated airlock and changed it to sanctum:

routes/api.php app/Http/Controllers/Auth/ConfirmPasswordController.php app/Http/Controllers/Auth/VerificationController.php composer.json app/Http/Kernel.php resources/js/pages/auth/password/email.vue resources/js/pages/auth/register.vue resources/js/pages/auth/login.vue

next composer update npm run watch

but I still get the same error 419 edit .env also to no avail