The-Commit-Company/frappe-react-sdk

CSRFTokenError on some browsers when useFrappePostCall is called

chipohameja opened this issue · 1 comments

After deployment on a VPS, I get CSRFTokenError 400 BAD REQUEST on most browsers when useFrappePostCall is called.

{exc_type: "CSRFTokenError",…} exc_type : "CSRFTokenError" _server_messages : "[\"{\\\"message\\\": \\\"Invalid Request\\\", \\\"title\\\": \\\"Message\\\", \\\"indicator\\\": \\\"red\\\", \\\"raise_exception\\\": 1, \\\"__frappe_exc_id\\\": \\\"e0dc4989030a221d2134e96f79a87661beee555e015fccca7439d7c1\\\"}\"]"

image

I checked the Network Headers tab and confirmed the csrftoken is passed
image

Everything works well on localhost. After deployment, it doesn't work on all browsers tested so far, apart from the chrome browser on my laptop. Chrome on other laptops doesn't work

@chipohameja This might be related to your backend, since Frappe React SDK is sending the CSRF token it gets