Enforce lowercase username registration policy

This commit is contained in:
Maxime Dor 2017-10-08 04:58:35 +02:00
parent 83cb8bfce2
commit 8efcda5967
2 changed files with 6 additions and 7 deletions

View File

@ -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

View File

@ -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