Skip to content

Commit

Permalink
refactor: remove redundant logic for refresh token func
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Jul 3, 2024
1 parent eb816fe commit 47a1a10
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/backend/app/auth/osm.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,10 @@ def create_tokens(payload: dict) -> tuple[str, str]:

def refresh_access_token(payload: dict) -> str:
"""Generate a new access token."""
access_token_payload = payload
access_token_payload["exp"] = (
int(time.time()) + 60
) # Access token valid for 15 minutes
payload["exp"] = int(time.time()) + 60 # Access token valid for 15 minutes

return jwt.encode(
access_token_payload,
payload,
settings.ENCRYPTION_KEY,
algorithm=settings.JWT_ENCRYPTION_ALGORITHM,
)
Expand Down

0 comments on commit 47a1a10

Please sign in to comment.