diff options
author | Half-Shot <will@half-shot.uk> | 2019-08-22 14:17:57 +0100 |
---|---|---|
committer | Half-Shot <will@half-shot.uk> | 2019-08-22 14:21:54 +0100 |
commit | 3320aaab3a9bba3f5872371aba7053b41af9d0a0 (patch) | |
tree | be424b87b362349e86e403914f1e1e2b640b9724 /synapse/rest/client | |
parent | Merge pull request #5850 from matrix-org/erikj/retry_well_known_on_fail (diff) | |
download | synapse-3320aaab3a9bba3f5872371aba7053b41af9d0a0.tar.xz |
Add "require_consent" parameter for registration
Diffstat (limited to 'synapse/rest/client')
-rw-r--r-- | synapse/rest/client/v2_alpha/register.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/rest/client/v2_alpha/register.py b/synapse/rest/client/v2_alpha/register.py index 05ea1459e3..724231f364 100644 --- a/synapse/rest/client/v2_alpha/register.py +++ b/synapse/rest/client/v2_alpha/register.py @@ -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) |