Actually use user_type, and make it default to "bot"

This commit is contained in:
Will Hunt 2020-02-20 14:39:26 +00:00 committed by GitHub
parent fd379b0108
commit ec58900cf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,9 +88,11 @@ async def register(request: web.Request) -> web.Response:
if err is not None: if err is not None:
return err return err
api, secret, username, password, user_type = info api, secret, username, password, user_type = info
if user_type is None:
user_type = "bot"
res = await api.request(Method.GET, Path.admin.register) res = await api.request(Method.GET, Path.admin.register)
nonce = res["nonce"] nonce = res["nonce"]
mac = generate_mac(secret, nonce, username, password) mac = generate_mac(secret, nonce, username, password, user_type)
try: try:
return web.json_response(await api.request(Method.POST, Path.admin.register, content={ return web.json_response(await api.request(Method.POST, Path.admin.register, content={
"nonce": nonce, "nonce": nonce,