Skip to content
Snippets Groups Projects
Commit 951fbf87 authored by pabois's avatar pabois
Browse files

Merge branch 'master' of github.com:noesya/osuny

parents 298b78e9 54e164b1
No related branches found
No related tags found
No related merge requests found
GIT
remote: https://github.com/lespoupeesrusses/two_factor_authentication.git
revision: 9ab2949fa597b1af5e27d3b349e8c0ae2771e3d6
revision: 27ba14d43900cc94c53082bdb4140b2d0559cfeb
specs:
two_factor_authentication (2.2.0)
devise
......@@ -79,7 +79,7 @@ GEM
autoprefixer-rails (10.3.3.0)
execjs (~> 2)
aws-eventstream (1.2.0)
aws-partitions (1.514.0)
aws-partitions (1.515.0)
aws-sdk-core (3.121.1)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
......@@ -191,7 +191,7 @@ GEM
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.5.1)
json (2.6.0)
kamifusen (1.9)
image_processing
rails
......
class Users::PasswordsController < Devise::PasswordsController
include WithLocale
include Users::AddUniversityToRequestParams
def update
super do |resource|
I18n.locale = resource.language.iso_code.to_sym if resource&.persisted?
end
if resource.errors.empty? && Devise.sign_in_after_reset_password && resource.need_two_factor_authentication?(warden.request)
warden.session(resource_name)[TwoFactorAuthentication::NEED_AUTHENTICATION] = true
resource.send_new_otp
end
end
end
......@@ -39,7 +39,7 @@ module User::WithAuthentication
true
end
def send_two_factor_authentication_code(code, options)
def send_two_factor_authentication_code(code, options = {})
if mobile_phone.blank? || options.dig(:delivery_method) == :email
send_devise_notification(:two_factor_authentication_code, code, {})
else
......
......@@ -38,7 +38,7 @@ en:
invalid: "Invalid email or password."
not_found_in_database: "Invalid email or password."
mailer:
two_factor_authentication:
two_factor_authentication_code:
subject: "Two-factor authentication code"
text_html: "Your two-factor authentication code for %{university} is %{code}<br>It will expire in 5 minutes."
sessions:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment