Interface RedirectLoginOptions<TAppState>

interface RedirectLoginOptions {
    appState?: TAppState;
    authorizationParams?: AuthorizationParams;
    fragment?: string;
    onRedirect?: ((url) => Promise<void>);
    openUrl?: ((url) => void | Promise<void>);
}

Type Parameters

  • TAppState = any

Hierarchy

  • BaseLoginOptions
    • RedirectLoginOptions

Properties

appState?: TAppState

Used to store state before doing the redirect

authorizationParams?: AuthorizationParams

URL parameters that will be sent back to the Authorization Server. This can be known parameters defined by Auth0 or custom parameters that you define.

fragment?: string

Used to add to the URL fragment before redirecting

onRedirect?: ((url) => Promise<void>)

Type declaration

    • (url): Promise<void>
    • Used to control the redirect and not rely on the SDK to do the actual redirect.

      Parameters

      • url: string

      Returns Promise<void>

      Example

      const client = new Auth0Client({
      async onRedirect(url) {
      window.location.replace(url);
      }
      });

      Deprecated

      since v2.0.1, use openUrl instead.

openUrl?: ((url) => void | Promise<void>)

Type declaration

    • (url): void | Promise<void>
    • Used to control the redirect and not rely on the SDK to do the actual redirect.

      Parameters

      • url: string

      Returns void | Promise<void>

      Example

      const client = new Auth0Client({
      openUrl(url) {
      window.location.replace(url);
      }
      });

      Example

      import { Browser } from '@capacitor/browser';

      const client = new Auth0Client({
      async openUrl(url) {
      await Browser.open({ url });
      }
      });