From 8efcda596740ef9a9a6f8f172f02fe891764dbee Mon Sep 17 00:00:00 2001 From: Maxime Dor Date: Sun, 8 Oct 2017 04:58:35 +0200 Subject: [PATCH] Enforce lowercase username registration policy --- README.md | 9 ++++----- rest_auth_provider.py | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index aa4a821..f0f6621 100644 --- a/README.md +++ b/README.md @@ -34,18 +34,17 @@ Set `endpoint` to the appropriate value. ## Next steps ### Lowercase username enforcement -If you would like to avoid user creating accounts with upper case letter in their usernames, -use the `enforceLowercase` config item. +To avoid creating users accounts with uppercase characters in their usernames and running into known +issues regarding case sensitivity in synapse, attempting to login with such username will fail. -It is highly recommended to enable this option to avoid nasty case sensitivity bugs and invites -management on a day-to-day basis. +It is highly recommended to keep this feature enable, but in case you would like to disable it: ``` [...] config: policy: registration: username: - enforceLowercase: True + enforceLowercase: False ``` ### Profile auto-fill diff --git a/rest_auth_provider.py b/rest_auth_provider.py index 4d3e880..9b04d76 100644 --- a/rest_auth_provider.py +++ b/rest_auth_provider.py @@ -66,7 +66,7 @@ class RestAuthProvider(object): logger.info("User %s does not exist yet, creating...", user_id) if localpart != localpart.lower() and self.regLower: - logger.info('User %s was not allowed to be created, enforcing lowercase policy', localpart) + logger.info('User %s was cannot be created due to username lowercase policy', localpart) defer.returnValue(False) user_id, access_token = (yield self.account_handler.register(localpart=localpart)) @@ -118,7 +118,7 @@ class RestAuthProvider(object): class _RestConfig(object): endpoint = '' - regLower = False + regLower = True setNameOnRegister = True setNameOnLogin = False