diff options
author | Robert Speicher <rspeicher@gmail.com> | 2016-05-31 05:17:26 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-05-31 05:25:35 +0300 |
commit | a602df303175aaaf1d5b60a2c009f5e259d187db (patch) | |
tree | 68eb6241dfbd4ccc8ae8474b73ead87018e92386 /app/controllers/sessions_controller.rb | |
parent | de20bd5b31715f096db3fb0155c82b0eea992b6c (diff) |
Pass the "Remember me" value to the 2FA token form
Prior, if a user had 2FA enabled and checked the "Remember me" field,
the setting was ignored because the OTP input was on a new form and the
value was never passed.
Closes #18000
Diffstat (limited to 'app/controllers/sessions_controller.rb')
-rw-r--r-- | app/controllers/sessions_controller.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index c29f4609e93..d68c2a708e3 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,5 +1,6 @@ class SessionsController < Devise::SessionsController include AuthenticatesWithTwoFactor + include Devise::Controllers::Rememberable include Recaptcha::ClientHelper skip_before_action :check_2fa_requirement, only: [:destroy] @@ -96,6 +97,7 @@ class SessionsController < Devise::SessionsController # Remove any lingering user data from login session.delete(:otp_user_id) + remember_me(user) if user_params[:remember_me] == '1' sign_in(user) and return else flash.now[:alert] = 'Invalid two-factor code.' |