diff --git a/.changeset/popular-chicken-share.md b/.changeset/popular-chicken-share.md new file mode 100644 index 000000000..0a8968351 --- /dev/null +++ b/.changeset/popular-chicken-share.md @@ -0,0 +1,5 @@ +--- +"@logto/core": patch +--- + +fix a bug that prevents invitee from accepting the organization invitation if the email letter case is not matching diff --git a/packages/core/src/libraries/organization-invitation.ts b/packages/core/src/libraries/organization-invitation.ts index 17859be08..a89a8717f 100644 --- a/packages/core/src/libraries/organization-invitation.ts +++ b/packages/core/src/libraries/organization-invitation.ts @@ -157,7 +157,7 @@ export class OrganizationInvitationLibrary { const user = await userQueries.findUserById(acceptedUserId); - if (user.primaryEmail !== entity.invitee) { + if (user.primaryEmail?.toLowerCase() !== entity.invitee.toLowerCase()) { throw new RequestError({ status: 422, code: 'request.invalid_input',