diff options
author | Brendan Abolivier <babolivier@matrix.org> | 2019-06-05 16:35:05 +0100 |
---|---|---|
committer | Brendan Abolivier <babolivier@matrix.org> | 2019-06-05 16:35:05 +0100 |
commit | fe13bd52acb67de56fb5e1866d0ec64fff10ed94 (patch) | |
tree | e1513f139c11bfadffcd30652020b851e18a1622 /synapse/api | |
parent | Only parse from email if provided (diff) | |
download | synapse-fe13bd52acb67de56fb5e1866d0ec64fff10ed94.tar.xz |
Don't check whether the user's account is expired on /send_mail requests
Diffstat (limited to 'synapse/api')
-rw-r--r-- | synapse/api/auth.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py index 0c6c93a87b..e24d942553 100644 --- a/synapse/api/auth.py +++ b/synapse/api/auth.py @@ -184,7 +184,13 @@ class Auth(object): return event_auth.get_public_keys(invite_event) @defer.inlineCallbacks - def get_user_by_req(self, request, allow_guest=False, rights="access"): + def get_user_by_req( + self, + request, + allow_guest=False, + rights="access", + allow_expired=False, + ): """ Get a registered user's ID. Args: @@ -229,7 +235,7 @@ class Auth(object): is_guest = user_info["is_guest"] # Deny the request if the user account has expired. - if self._account_validity.enabled: + 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: |