(sub, role, token_type, ttl)
| 42 | |
| 43 | |
| 44 | def create_token(sub, role, token_type, ttl): |
| 45 | now = int(time.time()) |
| 46 | payload = {"sub": sub, "role": role, "type": token_type, "iat": now, "exp": now + ttl} |
| 47 | return jwt.encode(payload, jwt_secret(), algorithm=JWT_ALGORITHM) |
| 48 | |
| 49 | |
| 50 | def create_access_token(sub, role): |
no test coverage detected