diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-03 01:29:43 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-03 01:29:43 +0300 |
commit | c7c74818948dbc63a284bb617b2af1937f999cc8 (patch) | |
tree | e34c4d4103dca7b2877e766f540415d4cf10a085 /app/controllers/invites_controller.rb | |
parent | 6cb0610108a079ae27d96d61c48216a9f3b0c476 (diff) |
Add latest changes from gitlab-org/security/gitlab@14-1-stable-ee
Diffstat (limited to 'app/controllers/invites_controller.rb')
-rw-r--r-- | app/controllers/invites_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/invites_controller.rb b/app/controllers/invites_controller.rb index e6aae144da6..3c81b698546 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? |