mirror of
https://github.com/grocy/grocy.git
synced 2025-08-19 20:11:16 +00:00
Reorganize project part 3
This commit is contained in:
@@ -12,14 +12,15 @@ class CliMiddleware
|
||||
|
||||
public function __invoke(\Slim\Http\Request $request, \Slim\Http\Response $response, callable $next)
|
||||
{
|
||||
$response = $next($request, $response);
|
||||
|
||||
if (PHP_SAPI !== 'cli')
|
||||
{
|
||||
$response->write('Please call this only from CLI');
|
||||
return $response->withHeader('Content-Type', 'text/plain')->withStatus(400);
|
||||
}
|
||||
|
||||
return $response->withHeader('Content-Type', 'text/plain');
|
||||
else
|
||||
{
|
||||
$response = $next($request, $response, $next);
|
||||
return $response->withHeader('Content-Type', 'text/plain');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace Grocy\Middleware;
|
||||
|
||||
use Grocy\Services\SessionService;
|
||||
use \Grocy\Services\SessionService;
|
||||
|
||||
class SessionMiddleware
|
||||
class SessionAuthMiddleware
|
||||
{
|
||||
public function __construct(\Slim\Container $container) {
|
||||
$this->container = $container;
|
Reference in New Issue
Block a user