summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2019-08-01 16:09:25 +0200
committerGitHub <noreply@github.com>2019-08-01 16:09:25 +0200
commit8ed9e63432b930cd880aef2edff30f8f910fb92c (patch)
tree42d3611a8fe6be383bd90371e04e8cc0cf1ee5c1 /synapse/handlers
parentMerge pull request #5810 from matrix-org/erikj/no_server_reachable (diff)
parentLint (diff)
downloadsynapse-8ed9e63432b930cd880aef2edff30f8f910fb92c.tar.xz
Account validity: allow defining HTML templates to serve the us… (#5807)
Account validity: allow defining HTML templates to serve the user on account renewal attempt
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/account_validity.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/synapse/handlers/account_validity.py b/synapse/handlers/account_validity.py
index 930204e2d0..34574f1a12 100644
--- a/synapse/handlers/account_validity.py
+++ b/synapse/handlers/account_validity.py
@@ -226,11 +226,19 @@ class AccountValidityHandler(object):
 
         Args:
             renewal_token (str): Token sent with the renewal request.
+        Returns:
+            bool: Whether the provided token is valid.
         """
-        user_id = yield self.store.get_user_from_renewal_token(renewal_token)
+        try:
+            user_id = yield self.store.get_user_from_renewal_token(renewal_token)
+        except StoreError:
+            defer.returnValue(False)
+
         logger.debug("Renewing an account for user %s", user_id)
         yield self.renew_account_for_user(user_id)
 
+        defer.returnValue(True)
+
     @defer.inlineCallbacks
     def renew_account_for_user(self, user_id, expiration_ts=None, email_sent=False):
         """Renews the account attached to a given user by pushing back the