From T234576It's been some 3 years since this became obsolete.
The editToken key of mw.users.tokens has been replaced by csrfToken since 298cf413dbc3fa4e (MediaWiki 1.27, released 2016).
The primary user of it, mediawiki.api was already migrated in the same commit. This means code using mw.Api#getToken('edit') will continue to work and is already using the new csrfToken key underneath.
What we need to migrate still is anything that uses editToken directly via mw.user.tokens.
Let's update whatever is using this in tarballed/WMF extensions and remove it from the payload.
Description
Description
Details
Details
Event Timeline
Comment Actions
@TheSandDoctor Hi! The mw.Api module was already updated and uses the new csrfToken key (instead of the old editToken key).
There is no need to change any code that uses mw.Api#getToken('edit'). The mw.api.postWithToken method is something else, and is a short cut for querying information from the API together with a token from getToken.
This task is about replacing code that is using the editToken key with mw.user.tokens, such as mw.user.tokens.get('editToken') needs to be replaced with mw.user.tokens.get('csrfToken'). The Codesearch link in my previous comment finds places in our Git repositories that currently use the old code still.
Comment Actions
I'll take a shot at this. Seems like a good first task to work at. @Krinkle thanks for the clarifications.
Comment Actions
Change 538407 had a related patch set uploaded (by TheSandDoctor; owner: TheSandDoctor):
[mediawiki/extensions/AbuseFilter@master] ext.abuseFilter.tools.js: Replace deprecated mw.users.tokens with csrfToken
Comment Actions
One done. I will work on the others later. Plan/hope is to have them all done this weekend. :)
Comment Actions
Change 538407 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] ext.abuseFilter.tools.js: Replace deprecated editToken with csrfToken
Comment Actions
I will update the remaining ones in the morning as it is getting quite late in my time zone.
Comment Actions
@TheSandDoctor There is few other extensions, do you have plan to work and on others?
Comment Actions
Yes. As I had explained above, the delay was because it was rather late in my timezone (e.g. I went to bed). The rest will be done within the next couple of hours.
Comment Actions
Patches have now been submitted for all of these and are just awaiting review and +2. :)