Commit 51ee1b83 authored by Valery Sizov's avatar Valery Sizov

Merge branch 'ce_upstream' of gitlab.com:gitlab-org/gitlab-ee into ce_upstream

parents 635517a3 41b9fa92
......@@ -91,27 +91,6 @@ class SessionsController < Devise::SessionsController
find_user.try(:two_factor_enabled?)
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
return unless Gitlab::Geo.secondary?
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