mirror of
https://github.com/maubot/maubot
synced 2025-08-29 23:30:39 +00:00
Fix docker-run and login endpoint
This commit is contained in:
parent
e9d48e863c
commit
e48cd26cb0
2 changed files with 8 additions and 7 deletions
|
@ -43,7 +43,7 @@ async def login(request: web.Request) -> web.Response:
|
|||
except json.JSONDecodeError:
|
||||
return ErrBodyNotJSON
|
||||
secret = data.get("secret")
|
||||
if secret and config["server.unshared_secret"] == secret:
|
||||
if secret and get_config()["server.unshared_secret"] == secret:
|
||||
user = data.get("user") or "root"
|
||||
return web.json_response({
|
||||
"token": create_token(user),
|
||||
|
@ -51,7 +51,7 @@ async def login(request: web.Request) -> web.Response:
|
|||
|
||||
username = data.get("username")
|
||||
password = data.get("password")
|
||||
if config.check_password(username, password):
|
||||
if get_config().check_password(username, password):
|
||||
return web.json_response({
|
||||
"token": create_token(username),
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue