Merge pull request #5047 from matrix-org/babolivier/account_expiration

Send out emails with links to extend an account's validity period
This commit is contained in:
Brendan Abolivier 2019-04-17 14:57:39 +01:00 committed by GitHub
commit 91934025b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 699 additions and 43 deletions

View file

@ -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",