Skip to content

openLoginModal(): Promise<void>

The openLoginModal is an asynchronous method that allows to open a modal with the login form inside.

Returned value

A returned value has a type of Promise<void> because of potential additional animations and transitions occurring while opening a modal.

Event Bus events

This API method dispatches the following events with the Event Bus:

Example

In this example we make a AuthenticationApi call to open a login modal.

useStorefront(async (storefront) => {
    const authenticationApi = await storefront.getApi('AuthenticationApi');

    await authenticationApi.openLoginModal();
});

Authentication API methods reference