aboutsummaryrefslogtreecommitdiff
path: root/RedirectAuth.php
diff options
context:
space:
mode:
Diffstat (limited to 'RedirectAuth.php')
-rw-r--r--RedirectAuth.php12
1 files changed, 4 insertions, 8 deletions
diff --git a/RedirectAuth.php b/RedirectAuth.php
index cd73e19..0d09f3d 100644
--- a/RedirectAuth.php
+++ b/RedirectAuth.php
@@ -214,19 +214,15 @@ class RedirectAuthProvider extends AbstractPrimaryAuthenticationProvider {
// The external user id has not yet been linked to a wiki account.
$user = $userFactory->newFromName($userInfo->userName, UserFactory::RIGOR_CREATABLE);
- if ($req instanceof OtherUsernameAuthRequest) {
- if ($user == null) {
- return AuthenticationResponse::newUI([new OtherUsernameAuthRequest($userInfo)], WfMessage('redirectauth-pick-other-username-invalid'));
- } else if ($user->isRegistered()) {
- return AuthenticationResponse::newUI([new OtherUsernameAuthRequest($userInfo)], WfMessage('redirectauth-pick-other-username-taken', $userInfo->userName));
- }
- }
if ($user == null) {
- return AuthenticationResponse::newFail(wfMessage('redirectauth-error-invalid-username', 'ProviderDetails'));
+ return AuthenticationResponse::newUI([new OtherUsernameAuthRequest($userInfo)], WfMessage('redirectauth-pick-other-username-invalid'));
}
if ($user->isRegistered()) {
// namespace collision
+ if ($req instanceof OtherUsernameAuthRequest) {
+ return AuthenticationResponse::newUI([new OtherUsernameAuthRequest($userInfo)], WfMessage('redirectauth-pick-other-username-taken', $userInfo->userName));
+ }
// We create the link manually because if the system message contained [[User:$1|]] MediaWiki would create an
// action=edit link in case the user page doesn't exist ... and linking an edit page would be confusing.