File tree Expand file tree Collapse file tree
application/forms/Account Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010use Icinga \Web \Form \Element \FakeFormElement ;
1111use Icinga \Web \Form \Validator \TotpTokenValidator ;
1212use Icinga \Web \Notification ;
13+ use Icinga \Web \Session ;
1314use ipl \Html \Attributes ;
1415use ipl \Html \HtmlElement ;
1516use ipl \Html \Text ;
17+ use ipl \Web \Common \CsrfCounterMeasure ;
1618use ipl \Web \Common \FormUid ;
1719use ipl \Web \Compat \CompatForm ;
1820use ipl \Web \Url ;
2527 */
2628class TwoFactorConfigForm extends CompatForm
2729{
30+ use CsrfCounterMeasure;
2831 use Database;
2932 use FormUid;
3033
@@ -75,6 +78,7 @@ public function setTwoFactor(TwoFactorTotp $twoFactor): static
7578
7679 protected function assemble (): void
7780 {
81+ $ this ->addCsrfCounterMeasure (Session::getSession ()->getId ());
7882 $ this ->addElement ($ this ->createUidElement ());
7983
8084 if (TwoFactorTotp::hasDbSecret ($ this ->getDb (), $ this ->user ->getUsername ())) {
You can’t perform that action at this time.
0 commit comments