refresh - JS SDK Auth Reference
This documentation provides a reference to the sdk.auth.refresh
method used to send requests to Medusa's Authentication API routes. It can be used for admin users, customers, or custom actor types.
This method refreshes a JWT authentication token, which is useful after validating the Oauth callback with callback. It sends a request to the Refresh Authentication Token API route.
The method stores the returned token and passes it in the header of subsequent requests. So, you can call other methods that require authentication after calling this method.
Learn more in the JS SDK Authentication guide.
For an example of implementing third-party authentication, refer to the Third-Party Login in Storefront guide.
Example#
Returns#
Promise
Promise<string>The refreshed JWT authentication token.
Promise
Promise<string>Was this page helpful?