fix(team): normalize email case in invite link generation
This commit is contained in:
parent
3f71f7becf
commit
0e93d36311
1 changed files with 2 additions and 0 deletions
|
|
@ -48,6 +48,8 @@ private function generateInviteLink(bool $sendEmail = false)
|
||||||
if (auth()->user()->role() === 'admin' && $this->role === 'owner') {
|
if (auth()->user()->role() === 'admin' && $this->role === 'owner') {
|
||||||
throw new \Exception('Admins cannot invite owners.');
|
throw new \Exception('Admins cannot invite owners.');
|
||||||
}
|
}
|
||||||
|
$this->email = strtolower($this->email);
|
||||||
|
|
||||||
$member_emails = currentTeam()->members()->get()->pluck('email');
|
$member_emails = currentTeam()->members()->get()->pluck('email');
|
||||||
if ($member_emails->contains($this->email)) {
|
if ($member_emails->contains($this->email)) {
|
||||||
return handleError(livewire: $this, customErrorMessage: "$this->email is already a member of ".currentTeam()->name.'.');
|
return handleError(livewire: $this, customErrorMessage: "$this->email is already a member of ".currentTeam()->name.'.');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue