jenkins-bot has submitted this change and it was merged.
Change subject: Allow API action=logout with BotPasswords
......................................................................
Allow API action=logout with BotPasswords
Since login is handled specially, do the same for logout.
Bug: T128335
Change-Id: Ib3b12d7045449b5c44f5ff7d1ecfce14416e8400
---
M includes/api/ApiLogout.php
1 file changed, 10 insertions(+), 1 deletion(-)
Approvals:
Gergő Tisza: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/api/ApiLogout.php b/includes/api/ApiLogout.php
index 2c38208..6a26e2e 100644
--- a/includes/api/ApiLogout.php
+++ b/includes/api/ApiLogout.php
@@ -24,6 +24,8 @@
* @file
*/
+use MediaWiki\Session\BotPasswordSessionProvider;
+
/**
* API module to allow users to log out of the wiki. API equivalent of
* Special:Userlogout.
@@ -33,8 +35,15 @@
class ApiLogout extends ApiBase {
public function execute() {
- // Make sure it's possible to log out
$session = MediaWiki\Session\SessionManager::getGlobalSession();
+
+ // Handle bot password logout specially
+ if ( $session->getProvider() instanceof
BotPasswordSessionProvider ) {
+ $session->unpersist();
+ return;
+ }
+
+ // Make sure it's possible to log out
if ( !$session->canSetUser() ) {
$this->dieUsage(
'Cannot log out when using ' .
--
To view, visit https://gerrit.wikimedia.org/r/273937
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib3b12d7045449b5c44f5ff7d1ecfce14416e8400
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: BryanDavis <[email protected]>
Gerrit-Reviewer: Gergő Tisza <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits