app/auth/service.py
def encode_auth_token(user_id):
    """Create a token with user_id and expiration date using secret key"""
    exp_days = app.config.get("AUTH_TOKEN_EXPIRATION_DAYS")
    exp_seconds = app.config.get("AUTH_TOKEN_EXPIRATION_SECONDS")
    exp_date = now() + datetime.timedelta(
        days=exp_days, seconds=exp_seconds
    )
    payload = {"exp": exp_date, "iat": now(), "sub": user_id}
    return jwt.encode(payload, app.config["SECRET_KEY"], algorithm="HS256").decode(
        ENCODING
    )
Create a token with user_id and expiration date using secret key
Create a token with user_id and expiration date using secret key
Create a token with user_id and expiration date using secret key
def encode_auth_token(user_id):
    exp_days = app.config.get("AUTH_TOKEN_EXPIRATION_DAYS")
    exp_seconds = app.config.get("AUTH_TOKEN_EXPIRATION_SECONDS")
    exp_date = now() + datetime.timedelta(
        days=exp_days, seconds=exp_seconds
    )
    payload = {"exp": exp_date, "iat": now(), "sub": user_id}
    return jwt.encode(payload, app.config["SECRET_KEY"], algorithm="HS256").decode(
        ENCODING
    )
def encode_auth_token ( user_id ) : exp_days = app . config . get ( "AUTH_TOKEN_EXPIRATION_DAYS" ) exp_seconds = app . config . get ( "AUTH_TOKEN_EXPIRATION_SECONDS" ) exp_date = now ( ) + datetime . timedelta ( days = exp_days , seconds = exp_seconds ) payload = { "exp" : exp_date , "iat" : now ( ) , "sub" : user_id } return jwt . encode ( payload , app . config [ "SECRET_KEY" ] , algorithm = "HS256" ) . decode ( ENCODING )
Create a token with user_id and expiration date using secret key
Create a token with user_id and expiration date using secret key
"""Create a token with user_id and expiration date using secret key"""
user_id