Skip to content

Commit

Permalink
morebits: Use csrfToken in mw.user.tokens (#712)
Browse files Browse the repository at this point in the history
morebits: Use csrfToken in mw.user.tokens
  • Loading branch information
Amorymeltzer committed Sep 26, 2019
2 parents 6dbd6f0 + 327e053 commit bab8522
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions morebits.js
Original file line number Diff line number Diff line change
Expand Up @@ -1793,7 +1793,7 @@ Morebits.wiki.page = function(pageName, currentAction) {
action: 'edit',
title: ctx.pageName,
summary: ctx.editSummary,
token: canUseMwUserToken ? mw.user.tokens.get('editToken') : ctx.editToken,
token: canUseMwUserToken ? mw.user.tokens.get('csrfToken') : ctx.editToken,
watchlist: ctx.watchlistOption
};

Expand Down Expand Up @@ -2477,7 +2477,7 @@ Morebits.wiki.page = function(pageName, currentAction) {
}
}

return !!mw.user.tokens.get('editToken');
return !!mw.user.tokens.get('csrfToken');
};

// callback from loadSuccess() for append() and prepend() threads
Expand Down Expand Up @@ -2775,7 +2775,7 @@ Morebits.wiki.page = function(pageName, currentAction) {
var pageTitle, token;

if (fnCanUseMwUserToken('delete')) {
token = mw.user.tokens.get('editToken');
token = mw.user.tokens.get('csrfToken');
pageTitle = ctx.pageName;
} else {
var xml = ctx.deleteApi.getXML();
Expand Down Expand Up @@ -2864,7 +2864,7 @@ Morebits.wiki.page = function(pageName, currentAction) {
// but until then (#615) the stupid hack below should work for
// undeletion.
if (fnCanUseMwUserToken('undelete')) {
token = mw.user.tokens.get('editToken');
token = mw.user.tokens.get('csrfToken');
pageTitle = ctx.pageName;
} else {
var xml = ctx.undeleteApi.getXML();
Expand All @@ -2887,7 +2887,7 @@ Morebits.wiki.page = function(pageName, currentAction) {
}

// KLUDGE:
token = mw.user.tokens.get('editToken');
token = mw.user.tokens.get('csrfToken');
pageTitle = ctx.pageName;
}

Expand Down

0 comments on commit bab8522

Please sign in to comment.