summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorTravis Ralston <travpc@gmail.com>2018-10-03 15:54:54 -0600
committerTravis Ralston <travpc@gmail.com>2018-10-03 17:39:45 -0600
commitf9d34a763c90811cd53965825799767569ba0e68 (patch)
treeafd2e35a1e72265acea78da35fe78f8c390f4a65 /synapse
parentMake the terms flow requried (diff)
downloadsynapse-f9d34a763c90811cd53965825799767569ba0e68.tar.xz
Auto-consent to the privacy policy if the user registered with terms
Diffstat (limited to 'synapse')
-rw-r--r--synapse/rest/client/v2_alpha/register.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/rest/client/v2_alpha/register.py b/synapse/rest/client/v2_alpha/register.py
index 78e63447a7..851ce6e9a4 100644
--- a/synapse/rest/client/v2_alpha/register.py
+++ b/synapse/rest/client/v2_alpha/register.py
@@ -460,6 +460,12 @@ class RegisterRestServlet(RestServlet):
                 params.get("bind_msisdn")
             )
 
+        if auth_result and LoginType.TERMS in auth_result:
+            logger.info("User %s has consented to the privacy policy" % registered_user_id)
+            yield self.store.user_set_consent_version(
+                registered_user_id, self.hs.config.user_consent_version,
+            )
+
         defer.returnValue((200, return_dict))
 
     def on_OPTIONS(self, _):