mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 00:37:52 +00:00
Csrf-token are now refreshed on each page-load to avoid timeout.
This commit is contained in:
@@ -20,7 +20,7 @@ class BaseCsrfVerifier implements IMiddleware
|
||||
$this->csrfToken = new CsrfToken();
|
||||
|
||||
// Generate or get the CSRF-Token from Cookie.
|
||||
$this->token = ($this->hasToken() === false) ? $this->generateToken() : $this->csrfToken->getToken();
|
||||
$this->token = $this->csrfToken->getToken($this->generateToken());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,6 +73,9 @@ class BaseCsrfVerifier implements IMiddleware
|
||||
|
||||
}
|
||||
|
||||
// Refresh existing token
|
||||
$this->csrfToken->refresh();
|
||||
|
||||
}
|
||||
|
||||
public function generateToken()
|
||||
|
||||
Reference in New Issue
Block a user