Fix csrf error on studio login

Description

*Context:* We have witnessed multiple, seemingly random "CSRF verification
failed" errors while signing in (with valid ID) to the Studio.

*Explanation:* The login form does not initially include a CSRF field.
The CSRF header of the request is appended to the studio login request
headers by intercepting the form validation. This intercept is performed
by the login.js script. Unfortunately, the login.js script is loaded
pretty late (at the end of the template). So if the login form is
validated sufficiently fast, the login.js script has no time to load and
append the X-CSRFToken header to the request.

*Proposed solution:* the CSRF token is already passed to the template via
the login view, so we just add a hidden field to the login form to
include the csrf token.

Status

Assignee

Adam Palay

Reporter

Edx Admin [Administrator]

Labels

Contributor Name

Régis Behmo

Repo

edx/edx-platform

Customer

None

Epic Link

None

OSCM Assignee

None

Platform Map Area (Levels 1 & 2)

None

Platform Map Area (Levels 3 & 4)

None

Priority

Unset
Configure