laravel-sanctum-vue-spa icon indicating copy to clipboard operation
laravel-sanctum-vue-spa copied to clipboard

419 (unknown status)

Open KitaXvost opened this issue 4 years ago • 3 comments

When sending the form in the console I get error 419

Tell me please how to fix it

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

KitaXvost avatar Oct 10 '20 09:10 KitaXvost

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 avatar Oct 10 '20 19:10 Tebra

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

SESSION_DOMAIN=localhost
SANCTUM_STATEFUL_DOMAINS=localhost

The requests are going trough now.

Tebra avatar Oct 10 '20 19:10 Tebra

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

KitaXvost avatar Oct 11 '20 10:10 KitaXvost