clojars / clojars-web

A community repository for open-source Clojure libraries
https://clojars.org
Eclipse Public License 1.0
468 stars 114 forks source link

Ensure emails are downcased; don't allow future duplicate email usage #882

Closed tobias closed 2 months ago

tobias commented 2 months ago

Eliminate reflection

Remove unused code

Ensure emails are stored & queried as downcased

This will ensure that any new email we write to the db will be downcased, and any query will downcase the email first before querying. This is to ensure that users don't accidentally create multiple users with semantically the same email address.

There are 118 existing users that have email addresses containing uppercase characters. Of those, 10 of them have a different user with the downcased email. All of these will need to be addressed as part of releasing this change.

Don't allow using an existing email

This prevents creating a new user or updating an existing user with the email address of another user. This does not add a uniqueness constraint to the database for the email address because we currently have 511 email addresses that are in use across at least 2 user records.