From: Derk-Jan Hartman Date: Sat, 10 May 2014 19:59:20 +0000 (+0200) Subject: mediawiki.api.watch: Use postWithToken to recover from an invalid token X-Git-Tag: 1.31.0-rc.0~15780 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/gestion/rappel_modifier.php?a=commitdiff_plain;h=720b9b86d19df5457c57cd6526463967eb67cbd6;p=lhc%2Fweb%2Fwiklou.git mediawiki.api.watch: Use postWithToken to recover from an invalid token Bug: 65157 Change-Id: I7a4282438eb9eb4a66b1c2ac286951bd3b6080e0 --- diff --git a/resources/src/mediawiki.api/mediawiki.api.watch.js b/resources/src/mediawiki.api/mediawiki.api.watch.js index aa33d86528..af2dee10ad 100644 --- a/resources/src/mediawiki.api/mediawiki.api.watch.js +++ b/resources/src/mediawiki.api/mediawiki.api.watch.js @@ -25,12 +25,11 @@ function doWatchInternal( pages, ok, err, addParams ) { // XXX: Parameter addParams is undocumented because we inherit this // documentation in the public method... - var apiPromise = this.post( + var apiPromise = this.postWithToken( 'watch', $.extend( { action: 'watch', titles: $.isArray( pages ) ? pages.join( '|' ) : String( pages ), - token: mw.user.tokens.get( 'watchToken' ), uselang: mw.config.get( 'wgUserLanguage' ) }, addParams