File tree Expand file tree Collapse file tree 2 files changed +3
-13
lines changed Expand file tree Collapse file tree 2 files changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
9494            return  $ this  ;
9595        }
9696        $ this  ->logger ->info ('TfaFrontendCheck isLoggedIn true ' );
97-         if  (in_array ($ this -> request ->getFullActionName (), $ this  ->getAllowedRoutes ($ customer ))) {
97+         if  (in_array ($ observer -> getEvent ()-> getRequest () ->getFullActionName (), $ this  ->getAllowedRoutes ($ customer ))) {
9898            $ this  ->logger ->info ('TfaFrontendCheck getAllowedRoutes true ' );
9999            return  $ this  ;
100100        }
@@ -108,20 +108,14 @@ public function execute(\Magento\Framework\Event\Observer $observer)
108108            // Redirect to 2FA authentication page 
109109            $ redirectionUrl  = $ this  ->url ->getUrl (self ::FRONTEND_2_FA_ACCOUNT_AUTHENTICATE_PATH );
110110            $ this  ->logger ->info ('TfaFrontendCheck is2faConfiguredForCustomer redirect ' ,[$ redirectionUrl ]);
111-             $ this  ->redirect ->setRedirect ($ redirectionUrl );
112- 
113-             return ;
111+             $ observer ->getControllerAction ()->getResponse ()->setRedirect ($ redirectionUrl );
114112        } elseif  ($ this  ->isCustomerInForced2faGroup ($ customer )) {
115113            // Redirect to 2FA setup page 
116114            $ this  ->messageManager ->addNoticeMessage (__ ('You need to set up Two Factor Authentication before continuing. ' ));
117115            $ redirectionUrl  = $ this  ->url ->getUrl (self ::FRONTEND_2_FA_ACCOUNT_SETUP_PATH );
118-             $ this  ->redirect ->setRedirect ($ redirectionUrl );
119- 
120-             return ;
116+             $ observer ->getControllerAction ()->getResponse ()->setRedirect ($ redirectionUrl );
121117        }
122118
123- 
124- 
125119        return  $ this  ;
126120    }
127121
Original file line number Diff line number Diff line change 77        <observer  name =" customer_2fa_check_logout" 
88                  instance =" Elgentos\Frontend2FA\Observer\CustomerAuthObserver"   />
99    </event >
10-     <event  name =" customer_login"  >
11-         <observer  name =" customer_2fa_login" 
12-                   instance =" Elgentos\Frontend2FA\Observer\TfaFrontendCheck"   />
13-     </event >
1410</config >
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments