summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorDirk Klimpel <5740567+dklimpel@users.noreply.github.com>2020-07-03 15:03:13 +0200
committerGitHub <noreply@github.com>2020-07-03 14:03:13 +0100
commit21a212f8e50343e9b55944fa75ece7911fd2cb70 (patch)
tree01fa808e274bea9593cff5784a577f8e0f313430 /synapse/handlers
parentAllow YAML config file to contain None (#7779) (diff)
downloadsynapse-21a212f8e50343e9b55944fa75ece7911fd2cb70.tar.xz
Fix inconsistent handling of upper and lower cases of email addresses. (#7021)
fixes #7016
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/auth.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py
index c3f86e7414..d713a06bf9 100644
--- a/synapse/handlers/auth.py
+++ b/synapse/handlers/auth.py
@@ -45,6 +45,7 @@ from synapse.metrics.background_process_metrics import run_as_background_process
 from synapse.module_api import ModuleApi
 from synapse.push.mailer import load_jinja2_templates
 from synapse.types import Requester, UserID
+from synapse.util.threepids import canonicalise_email
 
 from ._base import BaseHandler
 
@@ -928,7 +929,7 @@ class AuthHandler(BaseHandler):
         # for the presence of an email address during password reset was
         # case sensitive).
         if medium == "email":
-            address = address.lower()
+            address = canonicalise_email(address)
 
         await self.store.user_add_threepid(
             user_id, medium, address, validated_at, self.hs.get_clock().time_msec()
@@ -956,7 +957,7 @@ class AuthHandler(BaseHandler):
 
         # 'Canonicalise' email addresses as per above
         if medium == "email":
-            address = address.lower()
+            address = canonicalise_email(address)
 
         identity_handler = self.hs.get_handlers().identity_handler
         result = await identity_handler.try_unbind_threepid(