aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--RedirectAuth.php12
-rw-r--r--i18n/en.json1
2 files changed, 4 insertions, 9 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.
diff --git a/i18n/en.json b/i18n/en.json
index 7e5f74a..76bd20a 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -13,7 +13,6 @@
"redirectauth-collision-opt-create": "Create a new differently named account",
"redirectauth-pick-other-username-taken": "The username $1 is already taken, please choose another username",
"redirectauth-pick-other-username-invalid": "That username is invalid, please choose another username",
- "redirectauth-error-invalid-username": "The configured $1 returned an invalid username",
"redirectauth-linked-account": "Linked account:",
"redirectauth-link-your": "Link your $1 account",
"redirectauth-unlink-your": "Unlink your $1 account",