refresh-token

This commit is contained in:
2022-11-24 17:31:52 +03:00
parent 786bd20275
commit 84600308ad
6 changed files with 54 additions and 44 deletions

View File

@@ -8,12 +8,11 @@ from settings import JWT_ALGORITHM, JWT_SECRET_KEY
class JWTCodec:
@staticmethod
def encode(user: AuthInput, exp: datetime) -> str:
issued = datetime.now(tz=timezone.utc)
payload = {
"user_id": user.id,
"username": user.email or user.phone,
"exp": exp,
"iat": issued,
"iat": datetime.now(tz=timezone.utc),
"iss": "discours"
}
try: