summary refs log tree commit diff
path: root/synapse/api/auth.py
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/api/auth.py')
-rw-r--r--synapse/api/auth.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py

index 1bbb7b607f..71859c9bc0 100644 --- a/synapse/api/auth.py +++ b/synapse/api/auth.py
@@ -222,11 +222,10 @@ class Auth(object): # 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 = yield self.store.get_expiration_ts_for_user(user_id) - if ( - expiration_ts is not None - and self.clock.time_msec() >= expiration_ts - ): + expired = yield self.store.is_account_expired( + user_id, self.clock.time_msec() + ) + if expired: raise AuthError( 403, "User account has expired", errcode=Codes.EXPIRED_ACCOUNT )