Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

morebits: Use csrfToken in mw.user.tokens #712

Conversation

Amorymeltzer
Copy link
Collaborator

We need to migrate our token usage properly (#615, noted in #616) but one simple step is moving from mw.user.tokens.get('editToken') to mw.user.tokens.get('csrfToken'). Using csrfToken in favor of editToken was done back in 2015/2016 with the move away from action=tokens to meta=tokens. Both editToken and csrfToken have been provided in the mw.user.tokens object for quite some time, and the former is finally being deprecated (see T233442). The presence of the edittoken attribute in xml responses is unchanged.

We need to migrate our token usage properly (wikimedia-gadgets#615, noted in wikimedia-gadgets#616) but one simple step is moving from `mw.user.tokens.get('editToken')` to `mw.user.tokens.get('csrfToken')`.  Using `csrfToken` in favor of `editToken` was done back in 2015/2016 with the move away from `action=tokens` to `meta=tokens`.  Both `editToken` and `csrfToken` have been provided in the `mw.user.tokens` object for quite some time, and the former is finally being deprecated (see [T233442](https://phabricator.wikimedia.org/T233442)).  The presence of the `edittoken` attribute in xml responses is unchanged.
@Amorymeltzer Amorymeltzer added this to the September 2019 update milestone Sep 26, 2019
@Amorymeltzer Amorymeltzer added the Module: morebits The morebits.js library label Sep 26, 2019
@Amorymeltzer Amorymeltzer merged commit bab8522 into wikimedia-gadgets:master Sep 26, 2019
@Amorymeltzer Amorymeltzer deleted the morebits-mwusertokens-csrfToken branch September 26, 2019 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module: morebits The morebits.js library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant