Description
Description
Details
Details
Related Changes in Gerrit:
| Subject | Author | Repo | Branch | Lines +/- | |
|---|---|---|---|---|---|
| Use AuthPopup for reauth on EditPage | SBassett | mediawiki/core | master | +328 -29 |
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Open | None | T197160 All security-sensitive MediaWiki functionality should require elevated security | |||
| Resolved | sbassett | T427955 Prompt for reauthentication after submitting a site JS edit, not before | |||
| Resolved | sbassett | T429986 Use AuthPopup for reauth on EditPage |
Event Timeline
Comment Actions
Oh, nice! I experimented with this some time ago. AuthPopup currently only handles authentication, not re-authentication, so if you're logged in, it will just confirm that and close itself. It should be easy to change – the following hacky snippet worked for me locally, I'll leave it up to you how to integrate it into the code better:
const require = await mw.loader.using( 'mediawiki.authenticationPopup' ); const authPopup = require( 'mediawiki.authenticationPopup' ); // Hacky overrides so that this works while you're already logged in authPopup.loginPopupUrl += '&force=editsitejscss'; authPopup.checkLoggedIn = async function () { const resp = await new mw.Api().get( { 'action': 'query', 'meta': 'authmanagerinfo', 'amisecuritysensitiveoperation': 'editsitejscss' } ); return resp.query.authmanagerinfo.securitysensitiveoperationstatus === 'ok'; } authPopup.startPopupWindow();
Comment Actions
Change #1305516 had a related patch set uploaded (by SBassett; author: SBassett):
[mediawiki/core@master] Use AuthPopup for reauth on EditPage
Comment Actions
Change #1305516 merged by jenkins-bot:
[mediawiki/core@master] Use AuthPopup for reauth on EditPage