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
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-11-02 18:12:22 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-11-02 18:12:22 +0300
commit125c8a6a81c1c09911c09183c66768571cfd95b4 (patch)
tree638e73410f4180230c882d00d13d11b11bf033da /app/controllers/passwords_controller.rb
parentd67ccb290ab5e54ff42f9cd464a132fc1d3067e1 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/passwords_controller.rb')
-rw-r--r--app/controllers/passwords_controller.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/controllers/passwords_controller.rb b/app/controllers/passwords_controller.rb
index c764f2d0459..ead5d7c9026 100644
--- a/app/controllers/passwords_controller.rb
+++ b/app/controllers/passwords_controller.rb
@@ -1,8 +1,12 @@
# frozen_string_literal: true
class PasswordsController < Devise::PasswordsController
+ include GitlabRecaptcha
+
skip_before_action :require_no_authentication, only: [:edit, :update]
+ prepend_before_action :check_recaptcha, only: :create
+ before_action :load_recaptcha, only: :new
before_action :resource_from_email, only: [:create]
before_action :check_password_authentication_available, only: [:create]
before_action :throttle_reset, only: [:create]
@@ -59,6 +63,12 @@ class PasswordsController < Devise::PasswordsController
alert: _("Password authentication is unavailable.")
end
+ def check_recaptcha
+ return unless resource_params[:email].present?
+
+ super
+ end
+
def throttle_reset
return unless resource && resource.recently_sent_password_reset?