This API route is used by your storefront or frontend application when a third-party provider redirects to it after authentication. It validates the authentication with the third-party provider and, if successful, returns an authentication token. All query parameters received from the third-party provider, such as code, state, and error, must be passed as query parameters to this route.
You can decode the JWT token using libraries like react-jwt in the storefront. If the decoded data doesn’t have an actor_id property, then you must register the customer using the Create Customer API route passing the token in the request’s Authorization header.