eisbuk / EisBuk

Manage bookings for ice skating lessons
GNU Affero General Public License v3.0
0 stars 1 forks source link

Make the email checks case-insensitive #880

Closed ikusteu closed 10 months ago

ikusteu commented 10 months ago

There was a problem where a customer signed up with CUSTOMER.NAME@gmail.com, the auth entry has been created and customer self registered. Afterwards, at some point, the customer tried logging in with customer.name@gmail.com. Since google auth is already case insensitive, the customer was able to authenticate, but since findCustomerByEmail looks for an exact match, the differently cased email didn't match and the customer was prompted to self register (rather than being redirected to their /customer_area page)

Tasks

-note: it would probably be good to create a couple of string matching utils with different levels of strictness (in terms of whitespace, casing, etc...) and use those utils for string comparisons (in existing functionality and possible future one).

silviot commented 10 months ago

My proposal for a plan involves making sure that emails are always normalized when stored: lowercased and stripped of any whitespace possibly present.