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.
Name |
Last commit
|
Last update |
---|---|---|
.tx | Loading commit data... | |
cms | Loading commit data... | |
common | Loading commit data... | |
conf/locale | Loading commit data... | |
docs | Loading commit data... | |
lms | Loading commit data... | |
openedx | Loading commit data... | |
pavelib | Loading commit data... | |
requirements | Loading commit data... | |
scripts | Loading commit data... | |
test_root | Loading commit data... | |
vendor_extra/tinymce | Loading commit data... | |
.gitattributes | Loading commit data... | |
.gitignore | Loading commit data... | |
.jshintrc | Loading commit data... | |
.ruby-gemset | Loading commit data... | |
.ruby-version | Loading commit data... | |
AUTHORS | Loading commit data... | |
Brewfile | Loading commit data... | |
CHANGELOG.rst | Loading commit data... | |
CONTRIBUTING.rst | Loading commit data... | |
Gemfile | Loading commit data... | |
Gemfile.lock | Loading commit data... | |
LICENSE | Loading commit data... | |
README.md | Loading commit data... | |
manage.py | Loading commit data... | |
mongo_indexes.md | Loading commit data... | |
package.json | Loading commit data... | |
pavement.py | Loading commit data... | |
pylintrc | Loading commit data... | |
setup.cfg | Loading commit data... | |
setup.py | Loading commit data... |