Fixes 1700

This commit is contained in:
Jan Kotyz
2017-07-27 11:27:41 +02:00
parent 0a013e3edc
commit 19efbfecfa
+2 -2
View File
@@ -1320,7 +1320,7 @@ class AuthJWT(object):
# is the following safe or should we use # is the following safe or should we use
# calendar.timegm(datetime.datetime.utcnow().timetuple()) # calendar.timegm(datetime.datetime.utcnow().timetuple())
# result seem to be the same (seconds since epoch, in UTC) # result seem to be the same (seconds since epoch, in UTC)
now = time.mktime(datetime.datetime.now().timetuple()) now = time.mktime(datetime.datetime.utcnow().timetuple())
expires = now + self.expiration expires = now + self.expiration
payload = dict( payload = dict(
hmac_key=session_auth['hmac_key'], hmac_key=session_auth['hmac_key'],
@@ -1332,7 +1332,7 @@ class AuthJWT(object):
return payload return payload
def refresh_token(self, orig_payload): def refresh_token(self, orig_payload):
now = time.mktime(datetime.datetime.now().timetuple()) now = time.mktime(datetime.datetime.utcnow().timetuple())
if self.verify_expiration: if self.verify_expiration:
orig_exp = orig_payload['exp'] orig_exp = orig_payload['exp']
if orig_exp + self.leeway < now: if orig_exp + self.leeway < now: