Fix CSRF: add generateToken() call in /csrf-token endpoint

This commit is contained in:
mirivlad 2026-02-15 11:59:47 +00:00
parent c70b69ea7e
commit 353b562626
1 changed files with 1 additions and 0 deletions

View File

@ -48,6 +48,7 @@ $csrfMiddleware = $csrf;
// Add a route to get CSRF tokens via AJAX
$app->get('/csrf-token', function (Request $request, Response $response, $args) use ($csrf) {
$csrf->generateToken();
$data = [
'name_key' => $csrf->getTokenNameKey(),
'value_key' => $csrf->getTokenValueKey(),