'import',
'options'
];
- if ( $.inArray( action, csrfActions ) !== -1 ) {
+ if ( csrfActions.indexOf( action ) !== -1 ) {
mw.track( 'mw.deprecate', 'apitoken_' + action );
mw.log.warn( 'Use of the "' + action + '" token is deprecated. Use "csrf" instead.' );
return 'csrf';
return abortedPromise;
}
- return ( abortable = api.post( params, ajaxOptions ) ).then(
- // If no error, return to caller as-is
- null,
+ return ( abortable = api.post( params, ajaxOptions ) ).catch(
// Error handler
function ( code ) {
if ( code === 'badtoken' ) {