mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 10:54:52 +00:00
CSRF Token
Upon login, issue the user a CSRF token (in their session). This token should be provided when completing sensitive actions (e.g. deleting companies/clients, changing their password, etc.) Ref: https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html#synchronizer-token-pattern
This commit is contained in:
@@ -63,6 +63,9 @@ if(isset($_POST['login'])){
|
||||
$user_name = $row['user_name'];
|
||||
$user_id = $row['user_id'];
|
||||
|
||||
// CSRF Token
|
||||
$_SESSION['csrf_token'] = keygen();
|
||||
|
||||
// Setup encryption session key
|
||||
if (isset($row['user_specific_encryption_ciphertext']) && $row['user_role'] > 1) {
|
||||
$user_encryption_ciphertext = $row['user_specific_encryption_ciphertext'];
|
||||
|
||||
Reference in New Issue
Block a user