summary refs log tree commit diff
path: root/synapse/rest/client/v2_alpha/openid.py
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2019-12-05 21:00:43 +0000
committerBrendan Abolivier <babolivier@matrix.org>2019-12-05 21:00:43 +0000
commite126d83f7401456152e07042f8e8b7587adfe1b4 (patch)
treefc1a5fcabb0c4094166070cfd5d802cf2cd35546 /synapse/rest/client/v2_alpha/openid.py
parentMerge branch 'develop' into babolivier/msc1802 (diff)
parentReplace /admin/v1/users_paginate endpoint with /admin/v2/users (#5925) (diff)
downloadsynapse-e126d83f7401456152e07042f8e8b7587adfe1b4.tar.xz
Merge branch 'develop' into babolivier/msc1802
Diffstat (limited to 'synapse/rest/client/v2_alpha/openid.py')
-rw-r--r--synapse/rest/client/v2_alpha/openid.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/synapse/rest/client/v2_alpha/openid.py b/synapse/rest/client/v2_alpha/openid.py
index b4925c0f59..6ae9a5a8e9 100644
--- a/synapse/rest/client/v2_alpha/openid.py
+++ b/synapse/rest/client/v2_alpha/openid.py
@@ -16,8 +16,6 @@
 
 import logging
 
-from twisted.internet import defer
-
 from synapse.api.errors import AuthError
 from synapse.http.servlet import RestServlet, parse_json_object_from_request
 from synapse.util.stringutils import random_string
@@ -68,9 +66,8 @@ class IdTokenServlet(RestServlet):
         self.clock = hs.get_clock()
         self.server_name = hs.config.server_name
 
-    @defer.inlineCallbacks
-    def on_POST(self, request, user_id):
-        requester = yield self.auth.get_user_by_req(request)
+    async def on_POST(self, request, user_id):
+        requester = await self.auth.get_user_by_req(request)
         if user_id != requester.user.to_string():
             raise AuthError(403, "Cannot request tokens for other users.")
 
@@ -81,7 +78,7 @@ class IdTokenServlet(RestServlet):
         token = random_string(24)
         ts_valid_until_ms = self.clock.time_msec() + self.EXPIRES_MS
 
-        yield self.store.insert_open_id_token(token, ts_valid_until_ms, user_id)
+        await self.store.insert_open_id_token(token, ts_valid_until_ms, user_id)
 
         return (
             200,