summary refs log tree commit diff
path: root/synapse/api
diff options
context:
space:
mode:
authorMathieu Velten <matmaul@gmail.com>2020-09-23 17:06:28 +0200
committerGitHub <noreply@github.com>2020-09-23 16:06:28 +0100
commit916bb9d0d15cf941e73b2e808c553a1edd1c2eb9 (patch)
tree9938653b43064cd6f66f6fb633f1f00cb24f1fd4 /synapse/api
parentFix missing null character check on guest_access room state (#8373) (diff)
downloadsynapse-916bb9d0d15cf941e73b2e808c553a1edd1c2eb9.tar.xz
Don't push if an user account has expired (#8353)
Diffstat (limited to 'synapse/api')
-rw-r--r--synapse/api/auth.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index 75388643ee..1071a0576e 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -218,11 +218,7 @@ class Auth:
             # Deny the request if the user account has expired.
             if self._account_validity.enabled and not allow_expired:
                 user_id = user.to_string()
-                expiration_ts = await self.store.get_expiration_ts_for_user(user_id)
-                if (
-                    expiration_ts is not None
-                    and self.clock.time_msec() >= expiration_ts
-                ):
+                if await self.store.is_account_expired(user_id, self.clock.time_msec()):
                     raise AuthError(
                         403, "User account has expired", errcode=Codes.EXPIRED_ACCOUNT
                     )