Enhance user actions with CSRF protection and POST requests
Added CSRF protection and enforced POST requests for user delete and toggle status actions in UserController. Updated the users index view to use JavaScript for submitting POST forms with CSRF tokens for these actions, improving security and user experience. Also improved login success messages to include the user's full name.
This commit is contained in:
@@ -295,7 +295,7 @@ class TwoFactorController extends Controller
|
||||
'method' => $method
|
||||
]);
|
||||
|
||||
$_SESSION['success'] = 'Login successful!';
|
||||
$_SESSION['success'] = 'Login successful! Welcome back, ' . htmlspecialchars($user['full_name']) . '.';
|
||||
$this->redirect('/');
|
||||
} else {
|
||||
$_SESSION['error'] = 'Invalid verification code. Please try again.';
|
||||
|
||||
Reference in New Issue
Block a user