request = $request; $this->flash = $flash; $this->user_storage = $user_storage; } /** * @return JSON_Response|Redirect_Response|View_Response * * @throws User_Not_Found_Exception */ public function handle() { if ( ! $this->user_storage->is_2fa_enabled() ) { if ( $this->request->is_ajax() ) { return $this->json( [ 'error' => Notification::get( 'second-factor-status-disabled' ), ], 403 ); } $this->flash->add_message( 'error', 'second-factor-status-disabled' ); return $this->redirect( new Action_URL( Action_Index::SUBMENU_CHANNEL ) ); } return $this->next->handle(); } }