added in same-site cookie #15

Merged
rodude123 merged 3 commits from same-site-cookie-fix into master 2022-01-23 22:00:08 +00:00
2 changed files with 8 additions and 2 deletions
Showing only changes of commit 3f5ebd2de1 - Show all commits

5
dist/api/index.php vendored
View File

@ -12,6 +12,7 @@ use api\projectData;
use api\timelineData; use api\timelineData;
use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Http\Message\ServerRequestInterface as Request;
use Selective\SameSiteCookie\SameSiteCookieConfiguration;
use Slim\Factory\AppFactory; use Slim\Factory\AppFactory;
use Selective\SameSiteCookie\SameSiteCookieMiddleware; use Selective\SameSiteCookie\SameSiteCookieMiddleware;
@ -20,8 +21,10 @@ $app = AppFactory::create();
// create middleware // create middleware
$app->addRoutingMiddleware(); $app->addRoutingMiddleware();
$ssConfig = new SameSiteCookieConfiguration(["same_site" => "strict"]);
// add in same site cookie stuff // add in same site cookie stuff
$app->add(new SameSiteCookieMiddleware()); $app->add(new SameSiteCookieMiddleware($ssConfig));
// for error checking // for error checking
$errorMiddleware = $app->addErrorMiddleware(true, true, true); $errorMiddleware = $app->addErrorMiddleware(true, true, true);

View File

@ -12,6 +12,7 @@ use api\projectData;
use api\timelineData; use api\timelineData;
use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Http\Message\ServerRequestInterface as Request;
use Selective\SameSiteCookie\SameSiteCookieConfiguration;
use Slim\Factory\AppFactory; use Slim\Factory\AppFactory;
use Selective\SameSiteCookie\SameSiteCookieMiddleware; use Selective\SameSiteCookie\SameSiteCookieMiddleware;
@ -20,8 +21,10 @@ $app = AppFactory::create();
// create middleware // create middleware
$app->addRoutingMiddleware(); $app->addRoutingMiddleware();
$ssConfig = new SameSiteCookieConfiguration(["same_site" => "strict"]);
// add in same site cookie stuff // add in same site cookie stuff
$app->add(new SameSiteCookieMiddleware()); $app->add(new SameSiteCookieMiddleware($ssConfig));
// for error checking // for error checking
$errorMiddleware = $app->addErrorMiddleware(true, true, true); $errorMiddleware = $app->addErrorMiddleware(true, true, true);