diff options
author | Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> | 2021-04-19 19:16:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-19 19:16:34 +0100 |
commit | 71f0623de968f07292d5a092e9197f7513ab6cde (patch) | |
tree | 11034db4ceb3e2910510f88fd4287fc38c7a1f79 /synapse/api | |
parent | Sanity check identity server passed to bind/unbind. (#9802) (diff) | |
download | synapse-71f0623de968f07292d5a092e9197f7513ab6cde.tar.xz |
Port "Allow users to click account renewal links multiple times without hitting an 'Invalid Token' page #74" from synapse-dinsic (#9832)
This attempts to be a direct port of https://github.com/matrix-org/synapse-dinsic/pull/74 to mainline. There was some fiddling required to deal with the changes that have been made to mainline since (mainly dealing with the split of `RegistrationWorkerStore` from `RegistrationStore`, and the changes made to `self.make_request` in test code).
Diffstat (limited to 'synapse/api')
-rw-r--r-- | synapse/api/auth.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py index 6c13f53957..872fd100cd 100644 --- a/synapse/api/auth.py +++ b/synapse/api/auth.py @@ -79,7 +79,9 @@ class Auth: self._auth_blocking = AuthBlocking(self.hs) - self._account_validity = hs.config.account_validity + self._account_validity_enabled = ( + hs.config.account_validity.account_validity_enabled + ) self._track_appservice_user_ips = hs.config.track_appservice_user_ips self._macaroon_secret_key = hs.config.macaroon_secret_key @@ -222,7 +224,7 @@ class Auth: shadow_banned = user_info.shadow_banned # Deny the request if the user account has expired. - if self._account_validity.enabled and not allow_expired: + if self._account_validity_enabled and not allow_expired: if await self.store.is_account_expired( user_info.user_id, self.clock.time_msec() ): |