feat(auth): show OAuth-only registration notice on login page

Move the user creation check from OauthLoginService into
OauthSetting::allowsUserCreation(), so the login view can use it.
The login view now gets a can_register_with_oauth flag. The flag is
true when an enabled OAuth provider allows creating new users. The
view uses it to show the new auth.register_with_oauth message.
Add translations for the message in all locales, plus test coverage.
This commit is contained in:
Andras Bacsai
2026-10-02 16:45:33 +02:00
parent b1ddde2b64
commit 5b1fcd6e13
25 changed files with 55 additions and 15 deletions
+13
View File
@@ -37,6 +37,19 @@ class OauthSetting extends Model
);
}
/**
* Only OIDC exposes a provider-level user creation setting. Other providers
* follow the instance registration setting, as before OIDC support.
*/
public function allowsUserCreation(): bool
{
if (instanceSettings()->is_registration_enabled) {
return true;
}
return $this->provider === 'oidc' && $this->allow_registration;
}
public function couldBeEnabled(): bool
{
switch ($this->provider) {