do not sign in after reset password if 2fa

https://github.com/devise-two-factor/devise-two-factor#disabling-automatic-login-after-password-resets
thanks Greg Molnar
This commit is contained in:
DocuSeal committed 2023-10-22 13:19:47 +03:00
1 parent 74bef133b3
commit c639a3f733
3 files changed
+22 -1

No files matched your search

+8
View File
@@ -76,6 +76,14 @@ class User < ApplicationRecord
true
end
def self.sign_in_after_reset_password
if PasswordsController::Current.user.present?
!PasswordsController::Current.user.otp_required_for_login
else
true
end
end
def initials
[first_name&.first, last_name&.first].compact_blank.join.upcase
end