diff --git a/backend/app/core/dependencies.py b/backend/app/core/dependencies.py index 066388c..0b09b9d 100644 --- a/backend/app/core/dependencies.py +++ b/backend/app/core/dependencies.py @@ -21,6 +21,13 @@ async def get_current_user( ) -> User: token = credentials.credentials payload = decode_token(token) + + if payload.get("type") == "refresh": + raise HTTPException( + status_code=status.HTTP_401_UNAUTHORIZED, + detail="Could not validate credentials", + ) + user_id: str = payload.get("sub") if user_id is None: @@ -77,6 +84,9 @@ async def get_current_user_optional( return None payload = decode_token(token) + if payload.get("type") == "refresh": + return None + user_id: str = payload.get("sub") if user_id is None: