summary refs log tree commit diff
path: root/synapse/api
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2019-04-10 17:58:47 +0100
committerBrendan Abolivier <babolivier@matrix.org>2019-04-17 14:42:20 +0100
commit20f0617e87924c929f0db0c06d30de0c8d15081c (patch)
tree813206ef9ad64726925d976d74dbcf6afa8167c3 /synapse/api
parentAdd account expiration feature (diff)
downloadsynapse-20f0617e87924c929f0db0c06d30de0c8d15081c.tar.xz
Send out emails with links to extend an account's validity period
Diffstat (limited to 'synapse/api')
-rw-r--r--synapse/api/auth.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index 976e0dd18b..4482962510 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -230,8 +230,9 @@ class Auth(object):
 
             # Deny the request if the user account has expired.
             if self._account_validity.enabled:
-                expiration_ts = yield self.store.get_expiration_ts_for_user(user)
-                if self.clock.time_msec() >= expiration_ts:
+                user_id = user.to_string()
+                expiration_ts = yield self.store.get_expiration_ts_for_user(user_id)
+                if expiration_ts and self.clock.time_msec() >= expiration_ts:
                     raise AuthError(
                         403,
                         "User account has expired",