Skip to content

Commit 6a644ed

Browse files
committed
int exp and nbf
1 parent 1b5f31a commit 6a644ed

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

jwt_rsa/token.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,18 @@ def encode(self, expired=_nil, nbf=_nil, **claims) -> str:
4242

4343
claims.update(
4444
dict(
45-
exp=self._date_to_timestamp(
46-
expired,
47-
lambda: int(time.time() + self.__expires)
45+
exp=int(
46+
self._date_to_timestamp(
47+
expired,
48+
lambda: time.time() + self.__expires
49+
)
4850
),
49-
nbf=self._date_to_timestamp(
50-
nbf,
51-
lambda: int(time.time() - self.__nbf_delta),
52-
timedelta_func=sub
51+
nbf=int(
52+
self._date_to_timestamp(
53+
nbf,
54+
lambda: time.time() - self.__nbf_delta,
55+
timedelta_func=sub
56+
)
5357
),
5458
)
5559
)

0 commit comments

Comments
 (0)