Trails Packages
    Preparing search index...

    The authentication service requires an AuthPlugin to implement a concrete authentication flow.

    The plugin provides the current authentication state and the authentication fallback to the service.

    The current authentication state returned by getAuthState may change. If that is the case, the plugin must implement its auth state with Reactivity API.

    interface AuthPlugin {
        getAuthState(): AuthState;
        getLoginBehavior(): LoginBehavior;
        logout(options?: unknown): void | Promise<void>;
    }

    Hierarchy (View Summary)

    Index

    Methods

    • Returns the current authentication state.

      Objects returned by this method should not be mutated. Emit the changed event instead to communicate that there is a new state.

      Returns AuthState

    • Explicitly triggers a logout.

      Should result in a new state (including a changed event) if the user was authenticated.

      Parameters

      • Optionaloptions: unknown

        Custom options that may be supported by the plugin. The optional pluginOptions in AuthService.logout will be passed to this parameter. This parameter is not typed at this point (but should be in the plugin's actual implementation).

      Returns void | Promise<void>