mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:26:06 -04:00
Port rest.client.v2
This commit is contained in:
parent
af5d0ebc72
commit
9c41ba4c5f
23 changed files with 361 additions and 505 deletions
|
@ -15,8 +15,6 @@
|
|||
|
||||
import logging
|
||||
|
||||
from twisted.internet import defer
|
||||
|
||||
from synapse.api.constants import LoginType
|
||||
from synapse.api.errors import SynapseError
|
||||
from synapse.api.urls import CLIENT_API_PREFIX
|
||||
|
@ -171,8 +169,7 @@ class AuthRestServlet(RestServlet):
|
|||
else:
|
||||
raise SynapseError(404, "Unknown auth stage type")
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def on_POST(self, request, stagetype):
|
||||
async def on_POST(self, request, stagetype):
|
||||
|
||||
session = parse_string(request, "session")
|
||||
if not session:
|
||||
|
@ -186,7 +183,7 @@ class AuthRestServlet(RestServlet):
|
|||
|
||||
authdict = {"response": response, "session": session}
|
||||
|
||||
success = yield self.auth_handler.add_oob_auth(
|
||||
success = await self.auth_handler.add_oob_auth(
|
||||
LoginType.RECAPTCHA, authdict, self.hs.get_ip_from_request(request)
|
||||
)
|
||||
|
||||
|
@ -215,7 +212,7 @@ class AuthRestServlet(RestServlet):
|
|||
session = request.args["session"][0]
|
||||
authdict = {"session": session}
|
||||
|
||||
success = yield self.auth_handler.add_oob_auth(
|
||||
success = await self.auth_handler.add_oob_auth(
|
||||
LoginType.TERMS, authdict, self.hs.get_ip_from_request(request)
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue