Skip to content

Commit

Permalink
fix(core): invitee email check should be case insensitive (#5823)
Browse files Browse the repository at this point in the history
* fix(core): invitee email check should be case insensitive

* chore: add changeset
  • Loading branch information
charIeszhao authored May 6, 2024
1 parent 3e5ffc4 commit b4b8015
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/popular-chicken-share.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion packages/core/src/libraries/organization-invitation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit b4b8015

Please sign in to comment.