@@ -38,22 +38,22 @@ class TwoFactorController extends AbstractFrontendModuleController
3838 /**
3939 * @var PageModel
4040 */
41- protected $ page ;
41+ protected $ pageModel ;
4242
43- public function __invoke (Request $ request , ModuleModel $ model , string $ section , array $ classes = null , PageModel $ page = null ): Response
43+ public function __invoke (Request $ request , ModuleModel $ model , string $ section , array $ classes = null , PageModel $ pageModel = null ): Response
4444 {
4545 if (!$ this ->get ('security.helper ' )->isGranted ('IS_AUTHENTICATED_FULLY ' )) {
4646 // TODO: front end users should be able to re-authenticate after REMEMBERME
4747 return new Response ('' , Response::HTTP_NO_CONTENT );
4848 }
4949
50- $ this ->page = $ page ;
50+ $ this ->pageModel = $ pageModel ;
5151
5252 if (
53- $ this ->page instanceof PageModel
53+ $ this ->pageModel instanceof PageModel
5454 && $ this ->get ('contao.routing.scope_matcher ' )->isFrontendRequest ($ request )
5555 ) {
56- $ this ->page ->loadDetails ();
56+ $ this ->pageModel ->loadDetails ();
5757 }
5858
5959 return parent ::__invoke ($ request , $ model , $ section , $ classes );
@@ -87,19 +87,19 @@ protected function getResponse(Template $template, ModuleModel $model, Request $
8787 $ adapter = $ this ->get ('contao.framework ' )->getAdapter (PageModel::class);
8888
8989 $ redirectPage = $ model ->jumpTo > 0 ? $ adapter ->findByPk ($ model ->jumpTo ) : null ;
90- $ return = $ redirectPage instanceof PageModel ? $ redirectPage ->getAbsoluteUrl () : $ this ->page ->getAbsoluteUrl ();
90+ $ return = $ redirectPage instanceof PageModel ? $ redirectPage ->getAbsoluteUrl () : $ this ->pageModel ->getAbsoluteUrl ();
9191
92- $ template ->enforceTwoFactor = $ this ->page ->enforceTwoFactor ;
92+ $ template ->enforceTwoFactor = $ this ->pageModel ->enforceTwoFactor ;
9393 $ template ->targetPath = $ return ;
9494
9595 $ translator = $ this ->get ('translator ' );
9696
9797 // Inform the user if 2FA is enforced
98- if ($ this ->page ->enforceTwoFactor ) {
98+ if ($ this ->pageModel ->enforceTwoFactor ) {
9999 $ template ->message = $ translator ->trans ('MSC.twoFactorEnforced ' , [], 'contao_default ' );
100100 }
101101
102- if ((!$ user ->useTwoFactor && $ this ->page ->enforceTwoFactor ) || 'enable ' === $ request ->get ('2fa ' )) {
102+ if ((!$ user ->useTwoFactor && $ this ->pageModel ->enforceTwoFactor ) || 'enable ' === $ request ->get ('2fa ' )) {
103103 $ response = $ this ->enableTwoFactor ($ template , $ request , $ user , $ return );
104104
105105 if (null !== $ response ) {
@@ -134,7 +134,7 @@ protected function getResponse(Template $template, ModuleModel $model, Request $
134134 }
135135
136136 $ template ->isEnabled = (bool ) $ user ->useTwoFactor ;
137- $ template ->href = $ this ->page ->getAbsoluteUrl ().'?2fa=enable ' ;
137+ $ template ->href = $ this ->pageModel ->getAbsoluteUrl ().'?2fa=enable ' ;
138138 $ template ->backupCodes = json_decode ((string ) $ user ->backupCodes , true ) ?? [];
139139 $ template ->trustedDevices = $ this ->get ('contao.security.two_factor.trusted_device_manager ' )->getTrustedDevices ($ user );
140140
@@ -197,7 +197,7 @@ private function disableTwoFactor(FrontendUser $user): ?Response
197197 // Clear all trusted devices
198198 $ this ->get ('contao.security.two_factor.trusted_device_manager ' )->clearTrustedDevices ($ user );
199199
200- return new RedirectResponse ($ this ->page ->getAbsoluteUrl ());
200+ return new RedirectResponse ($ this ->pageModel ->getAbsoluteUrl ());
201201 }
202202
203203 private function generateBackupCodes (FrontendUser $ user ): void
0 commit comments