Add password challenge to 2FA settings, e-mail notifications (#11878)
Fix #3961
This commit is contained in:
@ -264,17 +264,20 @@ class User < ApplicationRecord
|
||||
end
|
||||
|
||||
def password_required?
|
||||
return false if Devise.pam_authentication || Devise.ldap_authentication
|
||||
return false if external?
|
||||
|
||||
super
|
||||
end
|
||||
|
||||
def send_reset_password_instructions
|
||||
return false if encrypted_password.blank? && (Devise.pam_authentication || Devise.ldap_authentication)
|
||||
return false if encrypted_password.blank?
|
||||
|
||||
super
|
||||
end
|
||||
|
||||
def reset_password!(new_password, new_password_confirmation)
|
||||
return false if encrypted_password.blank? && (Devise.pam_authentication || Devise.ldap_authentication)
|
||||
return false if encrypted_password.blank?
|
||||
|
||||
super
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user