mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 17:45:39 +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')
|
if ((!isset($_COOKIE[$this->SessionCookieName]) || !$sessionService->IsValidSession($_COOKIE[$this->SessionCookieName])) && $routeName !== 'login')
|
||||||
{
|
{
|
||||||
define('GROCY_AUTHENTICATED', false);
|
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'));
|
$response = $response->withHeader('Location', $this->AppContainer->get('UrlManager')->ConstructUrl('/login'));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user