summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorTravis Ralston <travpc@gmail.com>2018-10-15 16:10:29 -0600
committerTravis Ralston <travpc@gmail.com>2018-10-15 16:10:29 -0600
commita8ed93a4b55a19a478c9aba929bfea07e691abbf (patch)
treeb21ee2a4d2697731f94b02f47dcb2eedaebd37de /synapse
parentEnsure the terms params are actually provided (diff)
downloadsynapse-a8ed93a4b55a19a478c9aba929bfea07e691abbf.tar.xz
pep8
Diffstat (limited to 'synapse')
-rw-r--r--synapse/handlers/auth.py2
-rw-r--r--synapse/rest/client/v2_alpha/auth.py3
-rw-r--r--synapse/rest/client/v2_alpha/register.py12
3 files changed, 3 insertions, 14 deletions
diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py
index 12979f6ed3..bef796fd0c 100644
--- a/synapse/handlers/auth.py
+++ b/synapse/handlers/auth.py
@@ -469,7 +469,7 @@ class AuthHandler(BaseHandler):
     def _get_params_terms(self):
         return {
             "policies": {
-                    "privacy_policy": {
+                "privacy_policy": {
                     "version": self.hs.config.user_consent_version,
                     "en": {
                         "name": "Privacy Policy",
diff --git a/synapse/rest/client/v2_alpha/auth.py b/synapse/rest/client/v2_alpha/auth.py
index ec583ad16a..0b2933fe8e 100644
--- a/synapse/rest/client/v2_alpha/auth.py
+++ b/synapse/rest/client/v2_alpha/auth.py
@@ -158,9 +158,6 @@ class AuthRestServlet(RestServlet):
             defer.returnValue(None)
         elif stagetype == LoginType.TERMS:
             session = request.args['session'][0]
-            authdict = {
-                'session': session,
-            }
 
             html = TERMS_TEMPLATE % {
                 'session': session,
diff --git a/synapse/rest/client/v2_alpha/register.py b/synapse/rest/client/v2_alpha/register.py
index 851ce6e9a4..c5214330ad 100644
--- a/synapse/rest/client/v2_alpha/register.py
+++ b/synapse/rest/client/v2_alpha/register.py
@@ -359,19 +359,11 @@ class RegisterRestServlet(RestServlet):
                     [LoginType.MSISDN, LoginType.EMAIL_IDENTITY]
                 ])
 
+        # Append m.login.terms to all flows if we're requiring consent
         if self.hs.config.block_events_without_consent_error is not None:
             new_flows = []
             for flow in flows:
-                # To only allow registration if completing GDPR auth,
-                # making clients that don't support it use fallback auth.
                 flow.append(LoginType.TERMS)
-
-                # or to duplicate all the flows above with the GDPR flow on the
-                # end so clients that support it can use it but clients that don't
-                # continue to consent via the DM from server notices bot.
-                #new_flows.extend([
-                #    flow + [LoginType.TERMS]
-                #])
             flows.extend(new_flows)
 
         auth_result, params, session_id = yield self.auth_handler.check_auth(
@@ -461,7 +453,7 @@ class RegisterRestServlet(RestServlet):
             )
 
         if auth_result and LoginType.TERMS in auth_result:
-            logger.info("User %s has consented to the privacy policy" % registered_user_id)
+            logger.info("%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,
             )