mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 13:10:37 -04:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user