Skip to content

Commit

Permalink
fix token in form
Browse files Browse the repository at this point in the history
  • Loading branch information
aynsix committed Mar 13, 2024
1 parent 953f031 commit 95538df
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/Alchemy/Phrasea/Controller/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,12 @@ public function getAuthenticatedUser()

public function setSessionFormToken($formName)
{
$randomValue = bin2hex(random_bytes(35));
$this->app['session']->set($formName.'_token', $randomValue);
if (!$this->app['session']->has($formName.'_token')) {
$randomValue = bin2hex(random_bytes(35));
$this->app['session']->set($formName.'_token', $randomValue);

return $randomValue;
return $randomValue;
}
}

public function getSessionFormToken($formName)
Expand Down

0 comments on commit 95538df

Please sign in to comment.