diff --git a/server/main.py b/server/main.py index 2ac049b..28a10d5 100644 --- a/server/main.py +++ b/server/main.py @@ -146,7 +146,7 @@ async def login_callback(response: Response, username: str = Form(), password: s tkn = prep_uuid(uuid.uuid4().hex) apikeys[tkn] = tokens[tokennow] response.set_cookie("session", clean_uuid(tokennow)) - return {"msg": "", "key": tkn} + return {"msg": "", "key": clean_uuid(tkn)} else: return {"msg": "用户名或密码错误", "key": ""} @@ -264,7 +264,7 @@ async def login(state: str = "", client_id: str = "", redirect_url: str = "/user if (username != ""): tkn = prep_uuid(uuid.uuid4().hex) apikeys[tkn] = tokens[session] - return RedirectResponse(url=redirect_url+f"#access_token={tkn}&token_type=Bearer&state={state}") + return RedirectResponse(url=redirect_url+f"#access_token={clean_uuid(tkn)}&token_type=Bearer&state={state}") return templates.TemplateResponse("login.html", {"request": {}, "redirect_url": redirect_url, "state": state})