mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 01:32:38 +00:00
Don't return anything in the response body when unauthenticated (fixes #696)
This commit is contained in:
parent
11bf89e13a
commit
2778d2ad56
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user