I have a Angular and Django setup for a site and I’ve set up CSRF tokens and everything. However I don’t know how to generate an initial token so that the user can log in. When they try to log in, the backend complains that there is no CSRF token in the request.
I tried sending an empty get request when the login page is loaded, but that doesn’t seem to send back a token. I also tried adding the @ensure_csrf_cookie
decorator but that doesn’t work either.
I imagine there is some standard way of doing this?
bp-pet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.