I’m using auth0 management API in a project. Everything works fine if the API is called via requests. But when it is used through laravel queue (jobs), then some time after the worker starts, it begins to constantly return a 401 error “Expired token received for JSON Web Token validation”. All settings in the auth0 config have default values.
You can create a route in your Laravel application (e.g., /keep-token-alive). Use JavaScript to periodically send an AJAX request to this request, extending the session and preventing token expiration. Make sure to include the CSRF token in the request headers.