Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2018-03-22 13:34:42 +0300
committerTiago Botelho <tiagonbotelho@hotmail.com>2018-03-22 19:05:15 +0300
commit161a05b963b83fe50961ef41eebc5d1c28c3110e (patch)
tree5c98f6bc35eaea98652bb8cb9497ebac97b97667 /app
parentf742010257b0aa00a999ef5e20a17c15f980f4c1 (diff)
Writes specs
Diffstat (limited to 'app')
-rw-r--r--app/controllers/omniauth_callbacks_controller.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb
index fed8ba3ce28..5e6676ea513 100644
--- a/app/controllers/omniauth_callbacks_controller.rb
+++ b/app/controllers/omniauth_callbacks_controller.rb
@@ -21,9 +21,11 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
# Extend the standard implementation to also increment
# the number of failed sign in attempts
def failure
- user = User.find_by_username(params[:username])
+ if params[:username].present? && AuthHelper.form_based_provider?(failed_strategy.name)
+ user = User.by_login(params[:username])
- user&.increment_failed_attempts!
+ user&.increment_failed_attempts!
+ end
super
end