Avoid race condition expiration of csrf-token in SPA #4861
ivan-suhorukov
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello! I'm having a production issue with csrf token.
I have an SPA-application based on adonisjs and i use adonisjs/shield csrf protection. Somehow my production app logs many of "crsf-expired" messages everyday. Like that:
I suppose, some requests from frontend app has been blocked by csrf protection. I cannot reproduct this error on dev-environment, nor on production by myself. And i suppose this is race-condition error on frontend. Some simultanious requests share the same csrf-token and one of it fails.
Can it be true? And if it is, can we constrain requests, that updates xsrf-token, so api-requests, like
/api/*
does not refresh it?Maybe by accept filter function in
enableXsrfCookie
? Something like this:Thanks!
Beta Was this translation helpful? Give feedback.
All reactions