diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/sessions_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index fc3aa97b3..e679c85a4 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -12,9 +12,9 @@ class SessionsController < Devise::SessionsController # rubocop:enable Rails/LexicallyScopedActionFilter def find_user - return User.find(session[:otp_user_id]) if session[:otp_user_id] + return User.find_for_authentication(username: params[:user][:username]) if params[:user][:username] - User.find_for_authentication(username: params[:user][:username]) if params[:user][:username] + User.find(session[:otp_user_id]) if session[:otp_user_id] end def authenticate_with_2fa |