diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-07-23 15:45:39 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-23 15:45:39 -0400 |
commit | 83434df3812650f53c60e91fb23c2079db0fb5b8 (patch) | |
tree | f81784e35a6b4fbd015f5dab06e9101266f05c32 /synapse/handlers/auth.py | |
parent | Put a cache on `/state_ids` (#7931) (diff) | |
download | synapse-83434df3812650f53c60e91fb23c2079db0fb5b8.tar.xz |
Update the auth providers to be async. (#7935)
Diffstat (limited to 'synapse/handlers/auth.py')
-rw-r--r-- | synapse/handlers/auth.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py index a162392e4c..c7d921c21a 100644 --- a/synapse/handlers/auth.py +++ b/synapse/handlers/auth.py @@ -13,6 +13,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +import inspect import logging import time import unicodedata @@ -863,11 +864,15 @@ class AuthHandler(BaseHandler): # see if any of our auth providers want to know about this for provider in self.password_providers: if hasattr(provider, "on_logged_out"): - await provider.on_logged_out( + # This might return an awaitable, if it does block the log out + # until it completes. + result = provider.on_logged_out( user_id=str(user_info["user"]), device_id=user_info["device_id"], access_token=access_token, ) + if inspect.isawaitable(result): + await result # delete pushers associated with this access token if user_info["token_id"] is not None: |