Skip to content

Commit

Permalink
API action=logout requires token now
Browse files Browse the repository at this point in the history
  • Loading branch information
Rillke authored and tools.commons-maintenance-bot committed Jun 17, 2019
1 parent 56e0d1a commit 403de29
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions js/continuously.js
Expand Up @@ -78,7 +78,8 @@ bot = {
// would create a lot of different tokens due to replecation lag.
setTimeout( function() {
client.api.call({
action: 'tokens'
action: 'query',
meta: 'tokens'
}, function(r) {
setTimeout( function() {
bot.runTasks();
Expand Down Expand Up @@ -249,9 +250,17 @@ bot = {
} );
},
logOut: function( callback ) {
client.api.call( {
action: 'logout'
}, callback || function(){}, 'POST' );
client.api.call({
action: 'query',
meta: 'tokens'
}, function(r) {
console.log('Got a token');
console.log('Token: ' + r.tokens.csrftoken);
client.api.call({
action: 'logout',
token: r.tokens.csrftoken
}, callback || function(){}, 'POST');
});
}
};

Expand Down

0 comments on commit 403de29

Please sign in to comment.