-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Acceptance link issue when the same mail address due to a case-sensitive error. #1031
base: 3.x
Are you sure you want to change the base?
Acceptance link issue when the same mail address due to a case-sensitive error. #1031
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 3.x #1031 +/- ##
=========================================
Coverage 44.37% 44.37%
Complexity 3041 3041
=========================================
Files 342 342
Lines 11111 11111
=========================================
Hits 4931 4931
Misses 6180 6180 |
@@ -190,7 +190,9 @@ public function setStatus(int $status): TeamInvitationInterface { | |||
* {@inheritdoc} | |||
*/ | |||
public function getRecipient(): ?string { | |||
return $this->get('recipient')->value; | |||
$recipientEmail = $this->get('recipient')->value;; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an extra ;
at the end of the line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
@@ -190,7 +190,9 @@ public function setStatus(int $status): TeamInvitationInterface { | |||
* {@inheritdoc} | |||
*/ | |||
public function getRecipient(): ?string { | |||
return $this->get('recipient')->value; | |||
$recipientEmail = $this->get('recipient')->value;; | |||
$user = user_load_by_mail($recipientEmail); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Loading user approach looks quite expensive and if the email server case sensitive then it could also lead to problems.
Case sensitivity is a delicate topic anyway...
5eb0f8c
to
701ba31
Compare
When inviting a new member to my team, consider the following example: the user's email is [email protected], but I entered [email protected]. When they click on the acceptance link, they can't join the team due to a case-sensitive error.
In my code, it first retrieves the user object using the
user_load_by_mail
function with the recipient's email. If the user object is found, it retrieves the original user's email; otherwise, it obtains the recipient's email.