- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Menu
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Log-out Customer in Storefront
In this document, you'll learn how to log-out a customer in the storefront based on the authentication method.
Log-Out for JWT Token#
If you're authenticating the customer with their JWT token, remove the stored token from the browser.
For example, if you've stored the JWT token in the localStorage
, remove the item from it:
Log-Out for Cookie Session#
If you're authenticating the customer with their cookie session ID, send a DELETE
request to the /auth/session
.
For example:
The API route returns nothing in the response. If the request was successful, you can perform any necessary work to unset the customer and redirect them to the login page.
Was this page helpful?