Open
Description
This issue needs to be re-specified, it's not ready for implementation right now.
We currently allow to store email addresses containing capital letters. This leads to some minor bugs, e.g. it is possible to invite the same email address multiple times with different capitalization: [email protected]
is treated as different from [email protected]
. This circumvents our unique index on the inviteEmail column of CampCollaboration.
For modifying the input which users submit in various input fields, we have input filters. One example is InputFilter\Trim
, which is used to trim whitespace from the start and end of input fields.
To fix the mixed-case email addresses, we should:
- Create a new input filter
InputFilter\Lowercase
, along with theInputFilter\LowercaseFilter
class which actually performs the modification - Add the
#[InputFilter\Lowercase]
annotation to Profile#email and Profile#newEmail - Add the
#[InputFilter\Lowercase]
annotation to CampCollaboration#inviteEmail - Add the
#[InputFilter\Lowercase]
annotation to ResetPassword#email - Add unit tests for the
InputFilter\LowercaseFilter
, similar to the tests for the trim filter - Add API tests for all API operations which use the modified fields (create and update on these three entities), similar to the already existing trim tests
- After the oauth flow we need to lowercase the email too, + search for the existing email with the lowercase email from the oauth flow
- Optional: Write a data migration to convert all existing data in the database to lower case.
⚠️ If there are already duplicate emails, we need a conflict resolution.
Maybe possible alternative:
- Use a collation for this field which ignores the case.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Design