Missing message properties when rendering pages for organization invites

Closes #44113

Signed-off-by: Pedro Igor <pigor.craveiro@gmail.com>
This commit is contained in:
Pedro Igor
2025-11-11 08:07:17 -03:00
parent 26bdee3052
commit 9d728dd686
3 changed files with 5 additions and 3 deletions

View File

@@ -115,7 +115,8 @@ public class InviteOrgActionTokenHandler extends AbstractActionTokenHandler<Invi
event.user(user).error(Errors.USER_ORG_MEMBER_ALREADY);
return session.getProvider(LoginFormsProvider.class)
.setAuthenticationSession(authSession)
.setInfo(Messages.ORG_MEMBER_ALREADY, user.getUsername())
.setAttribute("messageHeader", Messages.STALE_INVITE_ORG_LINK)
.setInfo(Messages.ORG_MEMBER_ALREADY, user.getUsername(), organization.getName())
.setAttribute("pageRedirectUri", organization.getRedirectUrl())
.createInfoPage();
}

View File

@@ -22,7 +22,6 @@ import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.keycloak.services.messages.Messages.ORG_MEMBER_ALREADY;
import java.io.IOException;
import java.util.Arrays;
@@ -146,7 +145,7 @@ public class OrganizationInvitationLinkTest extends AbstractOrganizationTest {
String link = getInvitationLinkFromEmail(user.getFirstName(), user.getLastName());
driver.navigate().to(link);
assertThat(driver.getPageSource(), containsString(ORG_MEMBER_ALREADY));
assertThat(driver.getPageSource(), containsString("You are already a member of the neworg organization."));
infoPage.clickBackToApplicationLink();
// redirect to the redirectUrl of the organization

View File

@@ -559,3 +559,5 @@ organization.select=Select an organization to proceed:
notMemberOfOrganization=User is not a member of the organization {0}
notMemberOfAnyOrganization=User is not a member of any organization
emailVerificationPending=A verification email was sent to {0}. You can submit without changes to resend the verification email, or enter a different email address.
orgMemberAlready=You are already a member of the {1} organization.
staleInviteOrgLink=The link you clicked is no longer valid. It may have expired or already been used.