Files
Backend/utils/token.py
T

9 lines
203 B
Python
Raw Normal View History

2025-10-25 11:21:32 +03:00
import jwt
import os
2025-10-26 17:27:24 +03:00
from time import time
2025-10-25 11:21:32 +03:00
def generateKey(email, passwd):
key = os.getenv('KEY')
2025-10-26 17:27:24 +03:00
encoded = jwt.encode({email: passwd, 'iat': time()}, key, algorithm="HS256")
2025-10-25 11:21:32 +03:00
return encoded