Skip to content

Commit

Permalink
fix: time delta param now used if provided
Browse files Browse the repository at this point in the history
  • Loading branch information
fullerzz committed Aug 10, 2024
1 parent f6550da commit 0faccc2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/smolvault/auth/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def decode_token(token: str, db_client: DatabaseClient) -> UserInfo | None:

def create_access_token(data: dict[str, Any], expires_delta: timedelta | None = None) -> Token:
to_encode = data.copy()
if expires_delta: # noqa: SIM108
expire = datetime.now(ZoneInfo("UTC"))
if expires_delta:
expire = datetime.now(ZoneInfo("UTC")) + expires_delta
else:
expire = datetime.now(ZoneInfo("UTC")) + timedelta(minutes=15)
to_encode.update({"exp": expire})
Expand Down

0 comments on commit 0faccc2

Please sign in to comment.