INNER CODE UNIT · Python

new_exp

hunvreus/devpush · app/dependencies.py:235

    new_exp = now + timedelta(days=settings.auth_token_ttl_days)
    new_token = jwt.encode(
        {"alg": "HS256"},
        {
            "sub": user_id,
            "type": "auth_token",
            "iat": int(now.timestamp()),
            "exp": int(new_exp.timestamp()),
            "iss": settings.auth_token_issuer,
            "aud": settings.auth_token_audience,
        },
        settings.secret_key,
    )
    request.state.auth_cookie_refresh = {
        "value": new_token,
        "max_age": settings.auth_token_ttl_days * 24 * 60 * 60,
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…