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:
Diffstat (limited to 'app/controllers/invites_controller.rb')
-rw-r--r--app/controllers/invites_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/invites_controller.rb b/app/controllers/invites_controller.rb
index 9a674d02b3f..e2b7f691e01 100644
--- a/app/controllers/invites_controller.rb
+++ b/app/controllers/invites_controller.rb
@@ -20,7 +20,7 @@ class InvitesController < ApplicationController
end
def accept
- if member.accept_invite!(current_user)
+ if current_user_matches_invite? && member.accept_invite!(current_user)
redirect_to invite_details[:path], notice: helpers.invite_accepted_notice(member)
else
redirect_back_or_default(options: { alert: _("The invitation could not be accepted.") })
@@ -52,7 +52,7 @@ class InvitesController < ApplicationController
end
def current_user_matches_invite?
- @member.invite_email == current_user.email
+ current_user.verified_emails.include?(@member.invite_email)
end
def member?