mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-09-20 07:34:34 -04:00
Add "require_consent" parameter for registration
This commit is contained in:
parent
1b09cf8658
commit
3320aaab3a
3 changed files with 18 additions and 3 deletions
|
@ -525,6 +525,9 @@ class RegisterRestServlet(RestServlet):
|
|||
# downcased one in `username` for the mac calculation
|
||||
user = body["username"].encode("utf-8")
|
||||
|
||||
# do not require consent for this user (for example, bots)
|
||||
require_consent = body.get("require_consent", True)
|
||||
|
||||
# str() because otherwise hmac complains that 'unicode' does not
|
||||
# have the buffer interface
|
||||
got_mac = str(body["mac"])
|
||||
|
@ -542,7 +545,7 @@ class RegisterRestServlet(RestServlet):
|
|||
raise SynapseError(403, "HMAC incorrect")
|
||||
|
||||
user_id = yield self.registration_handler.register_user(
|
||||
localpart=username, password=password
|
||||
localpart=username, password=password, require_consent=require_consent,
|
||||
)
|
||||
|
||||
result = yield self._create_registration_details(user_id, body)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue