mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 00:54:47 -04:00
Lowercase all email addresses before querying db
Since we store all emails in the DB in lowercase (https://github.com/matrix-org/synapse/pull/1170)
This commit is contained in:
parent
ae7b4da4cc
commit
8c5009b628
2 changed files with 12 additions and 1 deletions
|
@ -96,6 +96,11 @@ class PasswordRestServlet(RestServlet):
|
|||
threepid = result[LoginType.EMAIL_IDENTITY]
|
||||
if 'medium' not in threepid or 'address' not in threepid:
|
||||
raise SynapseError(500, "Malformed threepid")
|
||||
if threepid['medium'] == 'email':
|
||||
# For emails, transform the address to lowercase.
|
||||
# We store all email addreses as lowercase in the DB.
|
||||
# (See add_threepid in synapse/handlers/auth.py)
|
||||
threepid['address'] = threepid['address'].lower()
|
||||
# if using email, we must know about the email they're authing with!
|
||||
threepid_user_id = yield self.hs.get_datastore().get_user_id_by_threepid(
|
||||
threepid['medium'], threepid['address']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue