timestamp
This commit is contained in:
parent
c035df9dc2
commit
071bbc8768
|
@ -9,9 +9,9 @@ from settings import JWT_ALGORITHM, JWT_SECRET_KEY
|
||||||
class JWTCodec:
|
class JWTCodec:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def encode(user: AuthInput, exp: datetime) -> str:
|
def encode(user: AuthInput, exp: datetime) -> str:
|
||||||
issued = int(time.mktime(datetime.now().timetuple()))
|
issued = int(datetime.now().timestamp())
|
||||||
print('[jwtcodec] issued at %r' % issued)
|
print('[jwtcodec] issued at %r' % issued)
|
||||||
expires = int(time.mktime(exp.timetuple()))
|
expires = int(exp.timestamp())
|
||||||
print('[jwtcodec] expires at %r' % expires)
|
print('[jwtcodec] expires at %r' % expires)
|
||||||
payload = {
|
payload = {
|
||||||
"user_id": user.id,
|
"user_id": user.id,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user