diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /app/controllers/omniauth_callbacks_controller.rb | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'app/controllers/omniauth_callbacks_controller.rb')
-rw-r--r-- | app/controllers/omniauth_callbacks_controller.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index 706a4843117..6a393405e4d 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -27,6 +27,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController user = User.by_login(params[:username]) user&.increment_failed_attempts! + log_failed_login(params[:username], failed_strategy.name) end super @@ -90,6 +91,10 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController private + def log_failed_login(user, provider) + # overridden in EE + end + def after_omniauth_failure_path_for(scope) if Feature.enabled?(:user_mode_in_session) return new_admin_session_path if current_user_mode.admin_mode_requested? @@ -198,6 +203,8 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController end def fail_login(user) + log_failed_login(user.username, oauth['provider']) + error_message = user.errors.full_messages.to_sentence redirect_to omniauth_error_path(oauth['provider'], error: error_message) |