|
|
|
@ -9,12 +9,13 @@ use MediaWiki\Auth\AuthenticationResponse;
|
|
|
|
|
use MediaWiki\Auth\AuthManager;
|
|
|
|
|
use MediaWiki\MediaWikiServices;
|
|
|
|
|
use MediaWiki\Session\SessionManager;
|
|
|
|
|
use MediaWiki\User\User;
|
|
|
|
|
use MediaWiki\Title\Title;
|
|
|
|
|
use MediaWiki\SpecialPage\SpecialPage;
|
|
|
|
|
use MediaWiki\Parser\Sanitizer;
|
|
|
|
|
use MediaWiki\Context\RequestContext;
|
|
|
|
|
use MediaWiki\Message\Message;
|
|
|
|
|
use StatusValue;
|
|
|
|
|
use User;
|
|
|
|
|
use Title;
|
|
|
|
|
use SpecialPage;
|
|
|
|
|
use Sanitizer;
|
|
|
|
|
use RequestContext;
|
|
|
|
|
|
|
|
|
|
class IsekaiOIDCAuth extends AbstractPrimaryAuthenticationProvider {
|
|
|
|
|
|
|
|
|
@ -164,7 +165,8 @@ class IsekaiOIDCAuth extends AbstractPrimaryAuthenticationProvider {
|
|
|
|
|
$authManager->setAuthenticationSessionData(self::USERNAME_SESSION_KEY, $username);
|
|
|
|
|
return AuthenticationResponse::newPass($username);
|
|
|
|
|
} else {
|
|
|
|
|
return AuthenticationResponse::newFail(wfMessage('isekaioidc-login-failed'));
|
|
|
|
|
$message = Message::newFromSpecifier('isekaioidc-login-failed');
|
|
|
|
|
return AuthenticationResponse::newFail($message);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -580,7 +582,6 @@ class IsekaiOIDCAuth extends AbstractPrimaryAuthenticationProvider {
|
|
|
|
|
$userIdentityLookup = MediaWikiServices::getInstance()->getUserIdentityLookup();
|
|
|
|
|
$userIdentity = $userIdentityLookup->getUserIdentityByName( $preferred_username );
|
|
|
|
|
if ( !$userIdentity || !$userIdentity->isRegistered() ) {
|
|
|
|
|
|
|
|
|
|
return $preferred_username;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|