Merge "Use built-in mw.Api 'badtoken' handling, also 'assert'/'assertuser'"

This commit is contained in:
jenkins-bot 2020-02-24 15:48:01 +00:00 committed by Gerrit Code Review
commit e94ebddaa4

View file

@ -112,7 +112,8 @@ function postReply( widget, parsoidData ) {
basetimestamp: pageData.baseTimeStamp, basetimestamp: pageData.baseTimeStamp,
starttimestamp: pageData.startTimeStamp, starttimestamp: pageData.startTimeStamp,
etag: pageData.etag, etag: pageData.etag,
token: pageData.token, assert: mw.user.isAnon() ? 'anon' : 'user',
assertuser: mw.user.getName() || undefined,
// This appears redundant currently, but as editing / new-topics get added, we'll expand it // This appears redundant currently, but as editing / new-topics get added, we'll expand it
dttags: [ 'discussiontools', 'discussiontools-reply', 'discussiontools-' + widget.mode ].join( ',' ) dttags: [ 'discussiontools', 'discussiontools-reply', 'discussiontools-' + widget.mode ].join( ',' )
} }
@ -165,8 +166,7 @@ function init( $container, state ) {
repliedToComment, repliedToComment,
parsoidPageData = { parsoidPageData = {
pageName: mw.config.get( 'wgRelevantPageName' ), pageName: mw.config.get( 'wgRelevantPageName' ),
oldId: mw.config.get( 'wgRevisionId' ), oldId: mw.config.get( 'wgRevisionId' )
token: mw.user.tokens.get( 'csrfToken' )
}; };
state = state || {}; state = state || {};