Hello! I'm running into an issue where I've created a Sling servlet that queries nodes and returns a JSON result. My web application uses the form-based AuthenticationHandler to establish a session, and then fetches the resource provided by my servlet.
This works fine until the session times out, after which a request for the servlet resource results in a 302 response that redirects to the login form. Is there something I should do, either on the request at the client, or in the servlet or its configuration, so that the client receives a 401 response instead of a redirect when authentication fails? Thank you for any help you can provide! John