Added in same site cookie middleware to account for csrf token

This commit is contained in:
2022-01-23 20:59:06 +00:00
parent 36335dc752
commit b05860f8da
4 changed files with 67 additions and 5 deletions
+6 -2
View File
@@ -12,12 +12,16 @@ use api\timelineData;
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Factory\AppFactory;
use Selective\SameSiteCookie\SameSiteCookieMiddleware;
// Start slim
$app = AppFactory::create();
// create middleware
$app->addRoutingMiddleware();
// add in same site cookie stuff
$app->add(new SameSiteCookieMiddleware());
// for error checking
$errorMiddleware = $app->addErrorMiddleware(true, true, true);
@@ -102,7 +106,7 @@ $app->post('/contact', function (Request $request, Response $response)
$headers1 .= "Content-Type: text/html; charset=UTF-8\r\n";
$message1 = "
<html>
<html lang=\"en\">
<head>
<title>{$data['subject']}</title>
<style>
@@ -182,7 +186,7 @@ $app->post('/contact', function (Request $request, Response $response)
$headers2 .= "Content-Type: text/html; charset=UTF-8\r\n";
$message2 = "
<html>
<html lang=\"en\">
<head>
<title>{$data['subject']}</title>
<style>