chore: bump version to 2.21.19 in package.json and enhance invitation validation (#434)

- Updated application version from 2.21.18 to 2.21.19 in package.json.
- Improved invitation validation by handling cases where the invitation is not found and ensuring email comparison is case insensitive.
This commit is contained in:
Giancarlo Buomprisco
2025-12-24 08:13:24 +01:00
committed by GitHub
parent 43038034fd
commit 4aac04ef0a
7 changed files with 250 additions and 241 deletions

View File

@@ -15,7 +15,7 @@
"ai": "5.0.116",
"lucide-react": "^0.562.0",
"next": "catalog:",
"nodemailer": "^7.0.11",
"nodemailer": "^7.0.12",
"react": "catalog:",
"react-dom": "catalog:",
"rxjs": "^7.8.2"

View File

@@ -81,8 +81,17 @@ async function JoinTeamAccountPage(props: JoinTeamAccountPageProps) {
// the user is logged in, we can now check if the token is valid
const invitation = await api.getInvitation(adminClient, token);
// the invitation is not found or expired or the email is not the same as the user's email
const isInvitationValid = invitation?.email === auth.data.email;
if (!invitation) {
return (
<AuthLayoutShell Logo={AppLogo}>
<InviteNotFoundOrExpired />
</AuthLayoutShell>
);
}
// the invitation is not found or expired or the email is not the same as the user's email (case insensitive)
const isInvitationValid =
invitation.email.toLowerCase() === auth.data.email.toLowerCase();
if (!isInvitationValid) {
return (