@creator.co/module-identity-client - v1.1.11
    Preparing search index...

    Class default

    IDM class that implements ExternalProviderDatasource, AuthenticatorDatasource, RegistrationDatasource, and UserDatasource interfaces.

    Implements

    Index

    Constructors

    • Parameters

      Returns default

      IDM Client module constructor, you should use one instance of this client per application instance, if multiple instances are used incorrect behavior is expected. This client is instantiate with the access tokens (key and secret), and options that will dictate the module behavior.

    Properties

    api: Api<any>

    Represents an API object with a generic type of any.

    The API object with a generic type of any.

    authenticator: default
    externalProviders: default

    Represents an external provider for the application.

    options: IDMOptions

    Represents the options for the IDM (Internet Download Manager).

    registration: default
    session: default

    Represents a user session with the application.

    sessionExternalProviderLoadedHandler?: () => void

    A function handler that is called when an external provider session is loaded.

    Type declaration

      • (): void
      • Returns void

        None

    sessionLoadedHandler?: (
        isRenewal: boolean,
        isLocalAuthentication: boolean,
    ) => void
    sessionLoadErrorHandler?: (
        resp: AuthorizationResponse | ErrorResponse,
        username?: string,
        isRenewal?: boolean,
    ) => void
    urlManager: default

    Represents a URLManager object that manages URLs.

    user: default

    Methods

    • Handles the authentication response from the server.

      Parameters

      • resp: object | AuthorizationResponse | ErrorResponse

        The response object from the server.

      • Optionalusername: string

        The username associated with the response.

      • OptionalisRenewal: boolean

        Indicates if the authentication is a renewal.

      • OptionalisLocalAuthentication: boolean

        Indicates if the authentication is local.

      Returns Promise<boolean>

      A promise that resolves when the authentication response is handled.

    • Checks if a user is logged in by calling the isLogged method of the session object.

      Returns boolean

      true if the user is logged in, false otherwise

    • Asynchronously loads the session with an optional login URL and extra context.

      Parameters

      • OptionaloptLoginURL: string

        Optional login URL to use during session loading.

      • OptionaloptExtraContext: any

        Optional extra context to provide during session loading.

      Returns Promise<null | boolean | "">

      True if the session was successfully loaded and the user is logged in, false otherwise.