Immutable solution version
Logout done right: Allowed Logout URLs, returnTo, and federated logout
Complete solution
Calling logout in the SDK often only clears the app session; the Auth0 session cookie survives and the next login silently re-authenticates. Real logout needs the /v2/logout round trip.
Logout done right
The two sessions
- Your app session (cookie, local storage).
- The Auth0 session (cookie on your tenant domain, the SSO cookie).
Clearing only the app session means the next loginWithRedirect returns instantly as the same user. Users experience this as "logout does not work".
SDK logout
await logout({ logoutParams: { returnTo: window.location.origin } });The SDK clears its local state and redirects to the tenant's /v2/logout endpoint with returnTo and client_id as query params. Auth0 clears its session and returns to returnTo.
Allowed Logout URLs
returnTo must be registered under Allowed Logout URLs, exact match. Unregistered returnTo values are ignored and the user lands on a generic page (or the request is rejected). Register every post-logout landing page.
Federated logout
If users logged in via an enterprise connection or social IdP, add federated=true to also log them out at the upstream IdP. Without it, the IdP session survives and the next login re-authenticates without a password. Only use it when the product wants true upstream logout; it can surprise users who share the IdP session with other apps.
Regular web apps
express-openid-connect with auth0Logout: true handles the /v2/logout redirect. Django/Flask: redirect manually as in the framework skills, and clear the server session first.
Checklist
- Logout clears app state, hits /v2/logout, and returnTo is allowlisted.
- Test in a fresh profile: login, logout, then visit /login and confirm you see the login page, not an instant redirect back in.
Evidence
Auth0's logout documentation describes the /v2/logout endpoint, the returnTo parameter requiring registration under Allowed Logout URLs, and the federated option for upstream IdP logout. The application settings doc defines Allowed Logout URLs. Verified against live docs 2026-09-26.
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_KMNHDzvEZ3IzPWHdRVKMvA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Logout done right: Allowed Logout URLs, returnTo, and federated logout <span>— Vectle</span></a>