Hi, just a quick question. If I do not want SSR, is there a possible way to safely handle/prevent csrf attacks sincec now csrf tokens can't be sent along with HTML?
p
proud-plumber-24205
08/25/2023, 5:56 AM
Hi @purple-kilobyte-92359
how are you rendering the UI? is it frontend only since you do not want server-side rendering?
The csrf token can still be set on the UI in a frontend only codebase (SPA) since the token is sent with the login/registration/verification/recovery/settings json payload. Ory uses a synchronizer token pattern which sets an additional csrf cookie in the browser. This is automatically set in fetch if you allow credentials.
https://www.ory.sh/docs/kratos/concepts/security#defenses-against-cross-site-request-forgery