mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-09-19 04:24:48 -04:00
Correctly handle AS registerations and add test
This commit is contained in:
parent
35be260090
commit
4c33796b20
5 changed files with 77 additions and 9 deletions
|
@ -655,9 +655,13 @@ class RegisterRestServlet(RestServlet):
|
|||
user_id = await self.registration_handler.appservice_register(
|
||||
username, as_token
|
||||
)
|
||||
return await self._create_registration_details(user_id, body)
|
||||
return await self._create_registration_details(
|
||||
user_id, body, is_appservice_ghost=True,
|
||||
)
|
||||
|
||||
async def _create_registration_details(self, user_id, params):
|
||||
async def _create_registration_details(
|
||||
self, user_id, params, is_appservice_ghost=False
|
||||
):
|
||||
"""Complete registration of newly-registered user
|
||||
|
||||
Allocates device_id if one was not given; also creates access_token.
|
||||
|
@ -674,7 +678,11 @@ class RegisterRestServlet(RestServlet):
|
|||
device_id = params.get("device_id")
|
||||
initial_display_name = params.get("initial_device_display_name")
|
||||
device_id, access_token = await self.registration_handler.register_device(
|
||||
user_id, device_id, initial_display_name, is_guest=False
|
||||
user_id,
|
||||
device_id,
|
||||
initial_display_name,
|
||||
is_guest=False,
|
||||
is_appservice_ghost=is_appservice_ghost,
|
||||
)
|
||||
|
||||
result.update({"access_token": access_token, "device_id": device_id})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue