Actually use user_type, and make it default to "bot"
This commit is contained in:
parent
fd379b0108
commit
ec58900cf2
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user