Skip to content

Commit

Permalink
fix(refs DPLAN-1878): prevent resending a post request on page-reload…
Browse files Browse the repository at this point in the history
… (3655)

* fix(refs DPLAN-1878): prevent resending a post request on page-reload by redirecting to self after a post has been processed.

* style: Apply php-cs-fixer

---------

Co-authored-by: Demos-CI <[email protected]>
  • Loading branch information
MoritzMandler and demosci committed Sep 12, 2024
1 parent 5f92822 commit 1d254a1
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2402,6 +2402,12 @@ public function boilerplateListAction(
$templateVars['list'] = $procedureService->getBoilerplateList($procedure);
$templateVars['boilerplateGroups'] = $procedureService->getBoilerplateGroups($procedureId);

if (!$request->isMethod('GET')) {
// prevent sending the same post multiple times when browser reloads the same page (F5)
// therefore redirect to self as a get call instead.
return $this->redirectBack($request);
}

return $this->renderTemplate(
'@DemosPlanCore/DemosPlanProcedure/administration_list_boilerplate.html.twig',
[
Expand Down

0 comments on commit 1d254a1

Please sign in to comment.