Skip to content

Commit

Permalink
Use timezone aware timestamps (UTC)
Browse files Browse the repository at this point in the history
  • Loading branch information
stveit committed Sep 24, 2024
1 parent d7daef5 commit cd9e8fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/nav/web/jwtgen.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import datetime, timedelta
from datetime import datetime, timedelta, timezone
from typing import Any, Optional

import jwt
Expand Down Expand Up @@ -34,7 +34,7 @@ def _generate_token(
else:
new_token = dict(token_data)

now = datetime.now()
now = datetime.now(timezone.utc)
name = JWTConf().get_nav_name()
updated_claims = {
'exp': (now + expiry_delta).timestamp(),
Expand Down

0 comments on commit cd9e8fb

Please sign in to comment.