S
S
syndarva2021-04-22 18:49:09
CSRF
syndarva, 2021-04-22 18:49:09

Do I need to enable CSRF for a SPA site?

Good afternoon. There is a front on Vue + Nuxt and a back on Laravel. Sanctum stands as a backing defense. Some POST requests require authorization, some do not. Do I need to set a CSRF token for all requests, or does Sanctum protect users enough?
Important comment: I don't use Laravel Blade.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vladislav Lyskov, 2021-04-22
@Vlatqa

No
UPD: go through the comments to this question Laravel + Nuxt: How to overcome error 419 - CSRF token mismatch?

G
gomerIT, 2021-04-22
@gomerIT

No cookies - no csrf.

S
Speakermen, 2021-04-22
@Speakermen

I think that yes, I'll look at the answers of more experienced ones, since I'm a coder. On laracaste, Laravel Authentication (Breeze, Jetstream, Fortify) is used for spa . There, a project was launched separately on vue and laravel on different ports About storing JWT tokens in browsers

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question