diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-11-30 03:20:04 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-11-30 03:20:04 +0000 |
commit | f0c44b5db94b5df10145ca3d1519c8e5459b8419 (patch) | |
tree | f6072c662356cbef070be4250e3caf4c3bb37f2e | |
parent | ef3a898d9a4880816baaa3980d5ea9e414320951 (diff) | |
parent | 6a7bc1c12219aedbbc3343f8e00aadbaab9ec266 (diff) | |
download | gitlab-ce-f0c44b5db94b5df10145ca3d1519c8e5459b8419.tar.gz |
Merge branch 'improve/invite-accept-page' into 'master'
Alert user when logged in user email is not the same as the invitation
## What does this MR do?
Add a note to the invitation page when the logged in user email is not the same as the invitation.
## Why was this MR needed?
Help users to not accept invitations logged in with a wrong account.
## Screenshots (if relevant)
![1](/uploads/78ac6d3db67c9ed60cf74a20ad240d0b/1.png)
## Relevant issues
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/24955
See merge request !7803
-rw-r--r-- | app/views/invites/show.html.haml | 13 | ||||
-rw-r--r-- | changelogs/unreleased/improve-invite-accept-page.yml | 4 |
2 files changed, 14 insertions, 3 deletions
diff --git a/app/views/invites/show.html.haml b/app/views/invites/show.html.haml index 2fd4859c1c6..882fdf1317d 100644 --- a/app/views/invites/show.html.haml +++ b/app/views/invites/show.html.haml @@ -6,7 +6,7 @@ - if inviter = @member.created_by by = link_to inviter.name, user_url(inviter) - to join + to join - case @member.source - when Project - project = @member.source @@ -20,11 +20,18 @@ = link_to group.name, group_url(group) as #{@member.human_access}. -- if @member.source.users.include?(current_user) +- is_member = @member.source.users.include?(current_user) + +- if is_member %p However, you are already a member of this #{@member.source.is_a?(Group) ? "group" : "project"}. Sign in using a different account to accept the invitation. -- else + +- if @member.invite_email != current_user.email + %p + Note that this invitation was sent to #{mail_to @member.invite_email}, but you are signed in as #{link_to current_user.to_reference, user_url(current_user)} with email #{mail_to current_user.email}. + +- unless is_member .actions = link_to "Accept invitation", accept_invite_url(@token), method: :post, class: "btn btn-success" = link_to "Decline", decline_invite_url(@token), method: :post, class: "btn btn-danger prepend-left-10" diff --git a/changelogs/unreleased/improve-invite-accept-page.yml b/changelogs/unreleased/improve-invite-accept-page.yml new file mode 100644 index 00000000000..8a09a5ae42f --- /dev/null +++ b/changelogs/unreleased/improve-invite-accept-page.yml @@ -0,0 +1,4 @@ +--- +title: Add note to the invite page when the logged in user email is not the same as the invitation +merge_request: +author: |