Skip to content

Commit 39031b4

Browse files
committed
fixed expiration time bug
1 parent 1812018 commit 39031b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

json_work_proof/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def duration_to(cls, duration: timedelta, end: datetime):
3434

3535
@classmethod
3636
def from_now(cls, duration: timedelta):
37-
return cls.start_until(datetime.utcnow(), duration)
37+
return cls.start_until(datetime.now(), duration)
3838

3939
@classproperty
4040
def unlimited(cls):
@@ -53,7 +53,7 @@ def contains(self, date: datetime):
5353

5454
# - Encode
5555

56-
def generate(self, claims: dict, expiration: datetime = datetime.utcnow() + timedelta(seconds=5*60)) -> str:
56+
def generate(self, claims: dict, expiration: datetime = datetime.now() + timedelta(seconds=5*60)) -> str:
5757

5858
header = { 'typ': 'JWP', 'alg': 'SHA256', 'dif': self.difficulty }
5959

0 commit comments

Comments
 (0)