Skip to content

closeLoginModal(): Promise<void>

The closeLoginModal is an asynchronous method that allows to close 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 closing a modal.

Example

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

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

    await authenticationApi.closeLoginModal();
});

Authentication API methods reference