Function loginWithEmbedded

  • Login with an embedded iframe modal. First displays a modal for the user to select their login method (email, Google, etc.), then opens a popup for OAuth authentication and returns tokens when complete.

    This provides a smoother user experience compared to loginWithPopup as the user can choose their login method before the OAuth popup opens.

    Parameters

    Returns Promise<TokenResponse>

    Promise resolving to token response

    Error if modal is closed or login fails

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

    const tokens = await loginWithEmbedded({
    clientId: 'your-client-id',
    redirectUri: 'https://your-app.com/callback',
    });
    console.log(tokens.accessToken);