summary refs log tree commit diff
path: root/synapse/module_api
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2020-04-15 12:40:18 -0400
committerGitHub <noreply@github.com>2020-04-15 12:40:18 -0400
commiteed7c5b89eee6951ac17861b1695817470bace36 (patch)
tree755c120c53df6f00dcdf75d2a8b00c3fdc705eb9 /synapse/module_api
parentAdd notes to the changelog about an additional SSO template. (#7259) (diff)
downloadsynapse-eed7c5b89eee6951ac17861b1695817470bace36.tar.xz
Convert auth handler to async/await (#7261)
Diffstat (limited to 'synapse/module_api')
-rw-r--r--synapse/module_api/__init__.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/module_api/__init__.py b/synapse/module_api/__init__.py
index afc3598e11..d678c0eb9b 100644
--- a/synapse/module_api/__init__.py
+++ b/synapse/module_api/__init__.py
@@ -86,7 +86,7 @@ class ModuleApi(object):
             Deferred[str|None]: Canonical (case-corrected) user_id, or None
                if the user is not registered.
         """
-        return self._auth_handler.check_user_exists(user_id)
+        return defer.ensureDeferred(self._auth_handler.check_user_exists(user_id))
 
     @defer.inlineCallbacks
     def register(self, localpart, displayname=None, emails=[]):
@@ -196,7 +196,9 @@ class ModuleApi(object):
             yield self._hs.get_device_handler().delete_device(user_id, device_id)
         else:
             # no associated device. Just delete the access token.
-            yield self._auth_handler.delete_access_token(access_token)
+            yield defer.ensureDeferred(
+                self._auth_handler.delete_access_token(access_token)
+            )
 
     def run_db_interaction(self, desc, func, *args, **kwargs):
         """Run a function with a database connection