1
0
mirror of https://github.com/typemill/typemill.git synced 2025-08-06 22:26:32 +02:00

Version 1.1.7 Removed session and improved security

This commit is contained in:
Sebastian
2018-05-29 21:50:51 +02:00
parent 96f595c05c
commit 6b7fac91a4
6 changed files with 73 additions and 42 deletions

View File

@@ -34,7 +34,7 @@ class AuthController extends Controller
*/
public function show(Request $request, Response $response, $args)
{
{
$data = array();
/* check previous login attemps */
@@ -63,7 +63,7 @@ class AuthController extends Controller
}
}
$this->c->view->render($response, '/auth/login.twig', $data);
$this->render($response, '/auth/login.twig', $data);
}
/**

View File

@@ -18,9 +18,17 @@ abstract class Controller
protected function render($response, $route, $data)
{
$data = $this->c->dispatcher->dispatch('onPageReady', new OnPageReady($data))->getData();
unset($_SESSION['old']);
if(isset($_SESSION['old']))
{
unset($_SESSION['old']);
}
if($this->c->request->getUri()->getScheme() == 'https')
{
$response = $response->withAddedHeader('Strict-Transport-Security', 'max-age=63072000');
}
$response = $response->withAddedHeader('X-Content-Type-Options', 'nosniff');
$response = $response->withAddedHeader('X-Frame-Options', 'SAMEORIGIN');
$response = $response->withAddedHeader('X-XSS-Protection', '1;mode=block');