From e5fc60763891f35d0e9f84d5f2a0879b8ae6807e Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Fri, 13 Dec 2024 07:18:14 +0100 Subject: [PATCH] added explicit "algorithms" argument applied patch from https://github.com/mrzenc/fastapi-dls-nixos/blob/main/add-algorithms-argument.patch from https://github.com/mrzenc/fastapi-dls-nixos --- app/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index c1897a7..d0a79f6 100644 --- a/app/main.py +++ b/app/main.py @@ -376,7 +376,7 @@ async def auth_v1_token(request: Request): j, cur_time = json_loads((await request.body()).decode('utf-8')), datetime.now(UTC) try: - payload = jwt.decode(token=j.get('auth_code'), key=jwt_decode_key) + payload = jwt.decode(token=j.get('auth_code'), key=jwt_decode_key, algorithms=ALGORITHMS.RS256) except JWTError as e: return JSONr(status_code=400, content={'status': 400, 'title': 'invalid token', 'detail': str(e)})