Commit 41b9fa92 authored by Timothy Andrew's avatar Timothy Andrew

Remove `SessionsController#authenticate_with_two_factor`.

- This was abstracted into the `AuthenticatesWithTwoFactor` module, but
  was probably resurrected during a merge.
parent 79642037
...@@ -91,27 +91,6 @@ class SessionsController < Devise::SessionsController ...@@ -91,27 +91,6 @@ class SessionsController < Devise::SessionsController
find_user.try(:two_factor_enabled?) find_user.try(:two_factor_enabled?)
end end
def authenticate_with_two_factor
user = self.resource = find_user
if user_params[:otp_attempt].present? && session[:otp_user_id]
if valid_otp_attempt?(user)
# 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.'
render :two_factor and return
end
else
if user && user.valid_password?(user_params[:password])
prompt_for_two_factor(user)
end
end
end
def gitlab_geo_login def gitlab_geo_login
return unless Gitlab::Geo.secondary? return unless Gitlab::Geo.secondary?
return if signed_in? return if signed_in?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment