I've a Filament Panel configured with ->registration and it seems that it's possible to create duplicate accounts by entering the same email in a different uppercase/lowercase combination.
For example:
[email protected] Works
[email protected] Also Works
[email protected] Also Works
Source code reference: https://github.com/filamentphp/filament/blob/4.x/packages/panels/src/Auth/Pages/Register.php#L184
The getEmailFormComponent does have the ->unique configuration set but that doesn't take effect when the case is changed
There are a few possible ways to resolve this
- Add an Eloquent mutator to the User model to convert emails to lowercase before creating the record. (In this case the DB unique constraint would catch the duplicate account)
- Change Filament to Mutate Form Data before saving, This would require an update to Filament or an internal patch modify the registration page
Please let me know if there are any other ways to resolve this that I'm not aware of.