From ec58900cf2c59bc4a2ef2acdb5ea03607757ea89 Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Thu, 20 Feb 2020 14:39:26 +0000 Subject: [PATCH] Actually use user_type, and make it default to "bot" --- maubot/management/api/client_auth.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/maubot/management/api/client_auth.py b/maubot/management/api/client_auth.py index faf318e..91fab07 100644 --- a/maubot/management/api/client_auth.py +++ b/maubot/management/api/client_auth.py @@ -88,9 +88,11 @@ async def register(request: web.Request) -> web.Response: if err is not None: return err api, secret, username, password, user_type = info + if user_type is None: + user_type = "bot" res = await api.request(Method.GET, Path.admin.register) nonce = res["nonce"] - mac = generate_mac(secret, nonce, username, password) + mac = generate_mac(secret, nonce, username, password, user_type) try: return web.json_response(await api.request(Method.POST, Path.admin.register, content={ "nonce": nonce,