// When user clicks sign outasync function handleSignOut() { await client.signOut(); // Revokes this device's refresh token // Clear local state, redirect to login page redirectTo("/login");}
✅ Refresh token storage: Securely stored (Keychain, EncryptedSharedPreferences, HttpOnly cookie)
✅ CSRF protection: State parameter in web flow validated automatically
✅ Token refresh: Session tokens auto-refresh before expiry
✅ Tokens never logged: SDK doesn’t log tokens
✅ Tokens never in URLs: SDK sends tokens in Authorization headers, not URLsYou don’t need to worry about these—SDK handles them automatically.
Never try to access or log tokens. Let SDK manage them entirely.
GET /callback?code=...&state=RANDOM_STATE// Verify state matches what you sent earlier// If mismatch: reject (CSRF attack)
Use HTTPS for all token-related requests
Store refresh token securely
Keychain (iOS)
EncryptedSharedPreferences (Android)
HttpOnly cookie (web)
Never in localStorage or plain SharedPreferences
Never log tokens
// Bad: don't do thisconsole.log("Token:", token); // ❌// Good: only log for debugging, never in productionif (DEBUG) console.log("Token length:", token.length);
Always use HTTPS for redirects and token endpoints