diff --git a/api/asset_manager/src/modules/auth/router.py b/api/asset_manager/src/modules/auth/router.py index ae0ca9c9..a90fab68 100644 --- a/api/asset_manager/src/modules/auth/router.py +++ b/api/asset_manager/src/modules/auth/router.py @@ -36,7 +36,7 @@ async def login(form: Annotated[OAuth2PasswordRequestForm, Depends()]): return JSONResponse( await Token.create( - user=f"id:{user.id}", + user=user.id, access_token=create_token( user_id=user.id, offset=timedelta(settings.ACCESS_TOKEN_EXPIRE_MIN) ), diff --git a/api/asset_manager/src/modules/auth/utils.py b/api/asset_manager/src/modules/auth/utils.py index cb9b59c3..cffe04fa 100644 --- a/api/asset_manager/src/modules/auth/utils.py +++ b/api/asset_manager/src/modules/auth/utils.py @@ -23,7 +23,7 @@ def create_token(user_id: uuid, offset: float) -> str: {"alg": settings.HASHING_SCHEME, "typ": "JWT"}, { "iss": "", - "sub": user_id, + "sub": f"id:{user_id}", "nbf": curr_time, "iat": curr_time, "exp": int(curr_time + offset),