request = $request; $this->flash = $flash; $this->notification_repository = $notification_repository; $this->user_storage = $user_storage; } /** * @return JSON_Response|Redirection_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( array( 'error' => $this->notification_repository->get_by_key( 'second-factor-status-disabled' ), ), 403 ); } $this->flash->add_message( 'error', 'second-factor-status-disabled' ); return $this->redirection( Route::SUBMENU_CHANNEL ); } return $this->next->handle(); } }