mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
password -> account servlet and add start of an 'add 3pid' endpoint
This commit is contained in:
parent
83b554437e
commit
94e1e58b4d
@ -16,7 +16,7 @@
|
||||
from . import (
|
||||
sync,
|
||||
filter,
|
||||
password,
|
||||
account,
|
||||
register,
|
||||
auth
|
||||
)
|
||||
@ -35,6 +35,6 @@ class ClientV2AlphaRestResource(JsonResource):
|
||||
def register_servlets(client_resource, hs):
|
||||
sync.register_servlets(hs, client_resource)
|
||||
filter.register_servlets(hs, client_resource)
|
||||
password.register_servlets(hs, client_resource)
|
||||
account.register_servlets(hs, client_resource)
|
||||
register.register_servlets(hs, client_resource)
|
||||
auth.register_servlets(hs, client_resource)
|
||||
|
@ -75,5 +75,20 @@ class PasswordRestServlet(RestServlet):
|
||||
return 200, {}
|
||||
|
||||
|
||||
class AddThreepidRestServlet(RestServlet):
|
||||
PATTERN = client_v2_pattern("/account/3pid")
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def on_POST(self, request):
|
||||
body = parse_json_dict_from_request(request)
|
||||
|
||||
if 'threePidCreds' not in body:
|
||||
raise SynapseError(400, "Missing param", Codes.MISSING_PARAM)
|
||||
|
||||
auth_user, client = yield self.auth.get_user_by_req(request)
|
||||
|
||||
|
||||
|
||||
|
||||
def register_servlets(hs, http_server):
|
||||
PasswordRestServlet(hs).register(http_server)
|
Loading…
Reference in New Issue
Block a user