mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 12:16:09 -04:00
Allow password providers to bind emails (#4947)
This PR allows password provider modules to bind email addresses when a user is registering and is motivated by matrix-org/matrix-synapse-ldap3#58
This commit is contained in:
parent
248014379e
commit
7a91b9d81c
3 changed files with 23 additions and 4 deletions
|
@ -74,14 +74,14 @@ class ModuleApi(object):
|
|||
return self._auth_handler.check_user_exists(user_id)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def register(self, localpart, displayname=None):
|
||||
def register(self, localpart, displayname=None, emails=[]):
|
||||
"""Registers a new user with given localpart and optional
|
||||
displayname.
|
||||
displayname, emails.
|
||||
|
||||
Args:
|
||||
localpart (str): The localpart of the new user.
|
||||
displayname (str|None): The displayname of the new user. If None,
|
||||
the user's displayname will default to `localpart`.
|
||||
displayname (str|None): The displayname of the new user.
|
||||
emails (List[str]): Emails to bind to the new user.
|
||||
|
||||
Returns:
|
||||
Deferred: a 2-tuple of (user_id, access_token)
|
||||
|
@ -90,6 +90,7 @@ class ModuleApi(object):
|
|||
reg = self.hs.get_registration_handler()
|
||||
user_id, access_token = yield reg.register(
|
||||
localpart=localpart, default_display_name=displayname,
|
||||
bind_emails=emails,
|
||||
)
|
||||
|
||||
defer.returnValue((user_id, access_token))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue