I’ve been working on a Slim 4 project and everything has been working fine on my localhost. However, once I upload the site and remove any localhost references my authentication middleware fails to properly redirect to my login route. If I remove the middleware by commenting it out the site works fine and all the routes are accessible. When I use Postman to test a URL with automatic redirection disabled I see that the status is always 200 when it should be 302. Additionally, I believe the middleware is being called and the control is getting through to generating a new Response since I can easily output it via PHP.
Any help would be greatly appreciated. I’ve included a screenshot of the basic auth code.