Function logoutWithRedirect

  • Logout with redirect. Redirects the current page to the auth domain's logout endpoint, which clears the session on the auth server (including social provider sessions like Google).

    This is the recommended logout method for most applications as it ensures complete session cleanup. After logout, the user will be redirected to the logoutRedirectUri if provided.

    Parameters

    Returns void

    import { logoutWithRedirect } from '@imtbl/auth';

    // In your logout button handler
    logoutWithRedirect({
    clientId: 'your-client-id',
    logoutRedirectUri: 'https://your-app.com',
    });
    // Page will redirect to auth domain, then back to your app