diff options
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 650b64e7551..6dd1b1415d6 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -570,7 +570,13 @@ class User < ActiveRecord::Base end def require_password? - password_automatically_set? && !ldap_user? + password_automatically_set? && !ldap_user? && current_application_settings.signin_enabled? + end + + def require_personal_access_token? + return false if current_application_settings.signin_enabled? || ldap_user? + + PersonalAccessTokensFinder.new(user: self, impersonation: false, state: 'active').execute.none? end def can_change_username? |