mirror of
https://github.com/grocy/grocy.git
synced 2025-08-16 18:54:35 +00:00
Don't return anything in the response body when unauthenticated (fixes #696)
This commit is contained in:
@@ -44,7 +44,7 @@ class SessionAuthMiddleware extends BaseMiddleware
|
||||
if ((!isset($_COOKIE[$this->SessionCookieName]) || !$sessionService->IsValidSession($_COOKIE[$this->SessionCookieName])) && $routeName !== 'login')
|
||||
{
|
||||
define('GROCY_AUTHENTICATED', false);
|
||||
$response = $handler->handle($request);
|
||||
$response = new \Slim\Psr7\Response(); // No content when unauthorized
|
||||
$response = $response->withHeader('Location', $this->AppContainer->get('UrlManager')->ConstructUrl('/login'));
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user