Request reauthentication in MultifactorManageForm
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 1 Dec 2020 14:52:08 +0000 (15:52 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 7 Dec 2020 10:11:11 +0000 (11:11 +0100)
wcfsetup/install/files/lib/form/MultifactorManageForm.class.php

index ec5e8d6d3430364b96233f8ec195820b7a77aeb2..c37482237f5b313073694f2c3b8eb834e6bc5526 100644 (file)
@@ -13,6 +13,7 @@ use wcf\system\form\builder\IFormParentNode;
 use wcf\system\form\builder\TemplateFormNode;
 use wcf\system\menu\user\UserMenu;
 use wcf\system\request\LinkHandler;
+use wcf\system\user\authentication\TReauthenticationCheck;
 use wcf\system\user\multifactor\IMultifactorMethod;
 use wcf\system\user\multifactor\Setup;
 use wcf\system\WCF;
@@ -27,6 +28,8 @@ use wcf\system\WCF;
  * @since      5.4
  */
 class MultifactorManageForm extends AbstractFormBuilderForm {
+       use TReauthenticationCheck;
+       
        /**
         * @inheritDoc
         */
@@ -85,6 +88,10 @@ class MultifactorManageForm extends AbstractFormBuilderForm {
                $this->processor = $this->method->getProcessor();
                $this->setup = Setup::find($this->method, WCF::getUser());
                
+               $this->requestReauthentication(LinkHandler::getInstance()->getControllerLink(static::class, [
+                       'object' => $this->method,
+               ]));
+               
                // Backup codes may not be managed if they are not yet set up.
                if ($this->method->objectType === 'com.woltlab.wcf.multifactor.backup' && !$this->setup) {
                        throw new PermissionDeniedException();