From 3a6f63f8f9016140653a2fce9ebec1cc55682ab3 Mon Sep 17 00:00:00 2001 From: sujan Date: Fri, 5 Jul 2024 13:14:03 +0545 Subject: [PATCH] addded created date on the project response, set expiry of access token to 1 hour --- src/backend/app/auth/osm.py | 2 +- src/backend/app/projects/project_schemas.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/app/auth/osm.py b/src/backend/app/auth/osm.py index cb03b8290..8ba814252 100644 --- a/src/backend/app/auth/osm.py +++ b/src/backend/app/auth/osm.py @@ -120,7 +120,7 @@ def create_tokens(jwt_data: dict) -> tuple[str, str]: def refresh_access_token(payload: dict) -> str: """Generate a new access token.""" - payload["exp"] = int(time.time()) + 60 # Access token valid for 15 minutes + payload["exp"] = int(time.time()) + 3600 # Access token valid for 1 hour return jwt.encode( payload, diff --git a/src/backend/app/projects/project_schemas.py b/src/backend/app/projects/project_schemas.py index 1b9ea4388..ce11e3030 100644 --- a/src/backend/app/projects/project_schemas.py +++ b/src/backend/app/projects/project_schemas.py @@ -321,6 +321,7 @@ class ProjectBase(BaseModel): author: User project_info: ProjectInfo status: ProjectStatus + created: datetime # location_str: str xform_category: Optional[XLSFormType] = None hashtags: Optional[List[str]] = None