Page MenuHomePhabricator

Add CSRF token to new lexeme form
Closed, ResolvedPublic

Description

Make the special page add a hidden input with the CSRF token to the HTML, then update the JS to add the token to the Vue-rendered form. (The PHP-generated hidden input will eventually be used by the noJS version of the special page, but we’re not there yet.)

Event Timeline

This turns out to be easier than expected due to the existence of mw.user.tokens.get().csrfToken – no PHP-side hidden input necessary (yet).

Change 763713 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/WikibaseLexeme@master] Provide csrf token to NewLexeme form

https://gerrit.wikimedia.org/r/763713

Change 763713 merged by jenkins-bot:

[mediawiki/extensions/WikibaseLexeme@master] Provide csrf token to NewLexeme form

https://gerrit.wikimedia.org/r/763713

Change 766795 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/WikibaseLexeme@master] Revert \"Provide csrf token to NewLexeme form\"

https://gerrit.wikimedia.org/r/766795

Change 766795 merged by jenkins-bot:

[mediawiki/extensions/WikibaseLexeme@master] Revert \"Provide csrf token to NewLexeme form\"

https://gerrit.wikimedia.org/r/766795

Urbanecm added a subscriber: Urbanecm.

Patch linked to this task was reverted, so I'm boldly reopening this :).

Change 767061 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/WikibaseLexeme@master] Provide csrf token to NewLexeme form (take 2)

https://gerrit.wikimedia.org/r/767061

Change 767061 merged by jenkins-bot:

[mediawiki/extensions/WikibaseLexeme@master] Provide csrf token to NewLexeme form (take 2)

https://gerrit.wikimedia.org/r/767061