From 7c24a7e9655b7b4f4c1181822e1bdb258c7444ed Mon Sep 17 00:00:00 2001 From: cxykevin Date: Mon, 26 Aug 2024 12:48:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=99=BB=E5=BD=95bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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})