> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: authentication.onLogout(handler: OnLogoutHandler) # Method Link: https://dev.wix.com/docs/sdk/host-modules/site/authentication/on-logout.md # Method Description: Registers a callback function to be called when a member logs out. Use this function to run code after a member logs out, such as clearing cached data, updating the UI, or redirecting to a public page. # Method Permissions: # Method Permissions Scopes IDs: undefined # Method Code Examples: ## Subscribe to logout events ```javascript ```typescript import { onLogout } from '@wix/authentication'; const unsubscribe = onLogout(() => { console.log('Member logged out'); // Clear any cached member data localStorage.removeItem('memberPreferences'); // Redirect to home page window.location.href = '/'; }); // Later, to stop listening: // unsubscribe(); ``` ``` ## Handle logout with UI updates ```javascript ```typescript import { onLogout, loggedIn } from '@wix/authentication'; function setupLogoutHandler() { const unsubscribe = onLogout(() => { // Hide member-only content document.querySelectorAll('.member-only').forEach(el => { el.style.display = 'none'; }); // Show login prompt document.getElementById('loginPrompt').style.display = 'block'; }); return unsubscribe; } ``` ```