mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-08-03 13:06:03 -04:00
Don't allow people to register user ids which only differ by case to an existing one
This commit is contained in:
parent
1f7642efa9
commit
aa3c9c7bd0
2 changed files with 13 additions and 2 deletions
|
@ -98,6 +98,17 @@ class RegistrationStore(SQLBaseStore):
|
|||
allow_none=True,
|
||||
)
|
||||
|
||||
def get_users_by_id_case_insensitive(self, user_id):
|
||||
def f(txn):
|
||||
sql = (
|
||||
"SELECT name, password_hash FROM users"
|
||||
" WHERE name = lower(?)"
|
||||
)
|
||||
txn.execute(sql, (user_id,))
|
||||
return self.cursor_to_dict(txn)
|
||||
|
||||
return self.runInteraction("get_users_by_id_case_insensitive", f)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def user_set_password_hash(self, user_id, password_hash):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue