ac-user-auth / app /utils /jwt_utils.py
MukeshKapoor25's picture
first commit
4438ee0
raw
history blame contribute delete
318 Bytes
from datetime import datetime, timedelta
from jose import jwt
SECRET_KEY = "your-secret-key"
ALGORITHM = "HS256"
def generate_jwt_token(mobile: str):
payload = {
"mobile": mobile,
"exp": datetime.utcnow() + timedelta(hours=1),
}
return jwt.encode(payload, SECRET_KEY, algorithm=ALGORITHM)