mirror of
https://github.com/fusion44/blitz_api.git
synced 2026-08-15 12:10:12 +02:00
fix: return auth token as plain text on login
This commit is contained in:
parent
3ab007138e
commit
f06d84c29f
2 changed files with 3 additions and 8 deletions
|
|
@ -17,11 +17,7 @@ def sign_jwt() -> Dict[str, str]:
|
|||
"expires": int(round(time.time() * 1000) + JWT_EXPIRY_TIME),
|
||||
}
|
||||
token = jwt.encode(payload, JWT_SECRET, algorithm=JWT_ALGORITHM)
|
||||
return token_response(token)
|
||||
|
||||
|
||||
def token_response(token: str):
|
||||
return {"access_token": token}
|
||||
return token
|
||||
|
||||
|
||||
def decodeJWT(token: str) -> dict:
|
||||
|
|
@ -45,7 +41,7 @@ def handle_local_cookie():
|
|||
|
||||
if enabled:
|
||||
f = open(full_cookie_file_path, "w")
|
||||
f.write(sign_jwt()["access_token"])
|
||||
f.write(sign_jwt())
|
||||
f.close()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -17,8 +17,7 @@ async def test_login(monkeypatch):
|
|||
|
||||
res = await sys.login(i=LoginInput(password="12345678"))
|
||||
assert type(res) is dict
|
||||
assert "access_token" in res
|
||||
assert res["access_token"].startswith("ey") == True
|
||||
assert res.startswith("ey") == True
|
||||
|
||||
async def fake_match_pw_negative(_):
|
||||
return False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue