FIX: Invite redemption error if user had already redeemed (#19070)

When opening the invite acceptance page when the user
was already logged in, we were still showing the Accept
Invitation prompt even if the user had already redeemed
the invitation and was present in the `InvitedUser` table.

This would lead to errors when the user clicked on the button.

This commit fixes the issue by hiding the Accept Invitation
button and showing an error message instead indicating that
the user had already redeemed the invitation. This only applies
to multi-use invite links.
This commit is contained in:
Martin Brennan
2022-11-17 15:51:58 +10:00
committed by GitHub
parent 5ee3e2932f
commit 40e8912395
7 changed files with 38 additions and 3 deletions

View File

@@ -2097,7 +2097,6 @@ en:
name_label: "Name"
password_label: "Password"
existing_user_can_redeem: "Redeem your invitation to a topic or group."
existing_user_cannot_redeem: "This invitation cannot be redeemed. Please ask the person who invited you to send you a new invitation."
password_reset:
continue: "Continue to %{site_name}"

View File

@@ -250,6 +250,8 @@ en:
<p>Otherwise please <a href="%{base_url}/password-reset">Reset Password</a>.</p>
not_found_template_link: |
<p>This invitation to <a href="%{base_url}">%{site_name}</a> can no longer be redeemed. Please ask the person who invited you to send you a new invitation.</p>
existing_user_cannot_redeem: "This invitation cannot be redeemed. Please ask the person who invited you to send you a new invitation."
existing_user_already_redemeed: "You have already redeemed this invite link."
user_exists: "There's no need to invite <b>%{email}</b>, they already have an account!"
invite_exists: "You already invited <b>%{email}</b>."
invalid_email: "%{email} isn't a valid email address."