revokeCustomerToken
Revoke customer token. It is used to log out the current customer.
Signature
declare function revokeCustomerToken(
context: Context,
customHeaders?: CustomHeaders
): Promise<FetchResult<RevokeCustomerTokenMutation>>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
context | Required | Context | |
customHeaders | Optional | CustomHeaders |
Referenced Types
- Context
- CustomHeaders
FetchResultRevokeCustomerTokenMutation
Examples
Simple usage if the customer is logged in and the token is valid:
import { sdk } from '~/sdk.config.ts';
// token will be invalidated and the customer will be logged out
await sdk.magento.revokeCustomerToken();