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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-26 17:34:23 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-26 17:34:23 +0300
commitf7fd30fc74686685b9582f291e27afe9466655e5 (patch)
tree4530f70d4affeef98b3bd385a0bb5bba6dbdbe7d /app
parente80b54a5d37aa0fad54e90a7bcc2af0de2f18be6 (diff)
Add latest changes from gitlab-org/security/gitlab@12-10-stable-ee
Diffstat (limited to 'app')
-rw-r--r--app/controllers/oauth/authorizations_controller.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/controllers/oauth/authorizations_controller.rb b/app/controllers/oauth/authorizations_controller.rb
index 2a4e659c5b9..f6ad2bf5312 100644
--- a/app/controllers/oauth/authorizations_controller.rb
+++ b/app/controllers/oauth/authorizations_controller.rb
@@ -4,6 +4,8 @@ class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
include Gitlab::Experimentation::ControllerConcern
include InitializesCurrentUserMode
+ before_action :verify_confirmed_email!, only: [:new]
+
layout 'profile'
# Overridden from Doorkeeper::AuthorizationsController to
@@ -21,4 +23,13 @@ class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
render "doorkeeper/authorizations/error"
end
end
+
+ private
+
+ def verify_confirmed_email!
+ return if current_user&.confirmed?
+
+ pre_auth.error = :unconfirmed_email
+ render "doorkeeper/authorizations/error"
+ end
end