Logout
5-Line Core
result = await gateway.logout(
access_token=token.access_token,
organization_id="default",
)
# Token is now invalidStep-by-Step
1
result = await gateway.logout(
access_token=token.access_token,
organization_id="default",
)2
if result.is_ok:
print("Logged out successfully")
else:
print(f"Logout failed: {result.error.message}")3
# After logout, the token no longer works
validate_result = await gateway.validate_session(
access_token=token.access_token,
organization_id="default",
)
print(f"Token valid: {validate_result.is_ok}") # False4
Logged out successfully
Token valid: FalseComplete Example
Common Pitfalls
Pitfall
Solution
Next Steps
Last updated
Was this helpful?