summary refs log tree commit diff
path: root/synapse/rest
diff options
context:
space:
mode:
authorNeil Johnson <neil@matrix.org>2018-08-31 15:42:51 +0100
committerNeil Johnson <neil@matrix.org>2018-08-31 15:42:51 +0100
commit09f3cf1a7ef0c533d052a5c87257503b710093c6 (patch)
tree527504fc38a6763a2ea9b1453f3332fbfd9f820b /synapse/rest
parentnews fragemnt (diff)
downloadsynapse-09f3cf1a7ef0c533d052a5c87257503b710093c6.tar.xz
ensure post registration auth checks do not fail erroneously
Diffstat (limited to 'synapse/rest')
-rw-r--r--synapse/rest/client/v1_only/register.py4
-rw-r--r--synapse/rest/client/v2_alpha/register.py4
2 files changed, 8 insertions, 0 deletions
diff --git a/synapse/rest/client/v1_only/register.py b/synapse/rest/client/v1_only/register.py
index 2c7bbcb171..95873e03d5 100644
--- a/synapse/rest/client/v1_only/register.py
+++ b/synapse/rest/client/v1_only/register.py
@@ -291,6 +291,10 @@ class RegisterRestServlet(ClientV1RestServlet):
             password=password,
             threepid=threepid,
         )
+        # Necessary due to auth checks prior to the threepid being
+        # written to the db
+        if self.store.is_threepid_reserved(threepid):
+            self.store.upsert_monthly_active_user(registered_user_id)
 
         if session[LoginType.EMAIL_IDENTITY]:
             logger.debug("Binding emails %s to %s" % (
diff --git a/synapse/rest/client/v2_alpha/register.py b/synapse/rest/client/v2_alpha/register.py
index 45113e5386..f22b7577ea 100644
--- a/synapse/rest/client/v2_alpha/register.py
+++ b/synapse/rest/client/v2_alpha/register.py
@@ -406,6 +406,10 @@ class RegisterRestServlet(RestServlet):
                 generate_token=False,
                 threepid=threepid,
             )
+            # Necessary due to auth checks prior to the threepid being
+            # written to the db
+            if self.store.is_threepid_reserved(threepid):
+                self.store.upsert_monthly_active_user(registered_user_id)
 
             # remember that we've now registered that user account, and with
             #  what user ID (since the user may not have specified)