Alokai

isLoggedIn

Check if the user is logged in.

Verifies if the user is logged in by checking if the vsf-commercetools-token cookie is set.

Signature

declare function isLoggedIn(
	context: CommercetoolsIntegrationContext
): Promise<boolean | isLoggedInResponse>;

Parameters

NameRequiredTypeDescription
contextRequiredCommercetoolsIntegrationContext

Returns

Returns a representation of the IsLoggedInResponse.

Referenced Types

Examples

Check if the user is logged in:

const { value } = await sdk.commerce.isLoggedIn();
if (value) {
 // User is logged in
}

On this page