request = $request; $this->flash = $flash; $this->options_storage = $options_storage; } /** * @inheritDoc */ public function handle() { if ( ! $this->options_storage->are_trusted_devices_enabled() ) { if ( $this->request->is_ajax() ) { return $this->json( [ 'error' => Notification::get( 'trusted-devices-disabled' ), ], 403 ); } $this->flash->add_message( 'error', 'trusted-devices-disabled' ); return $this->redirect( new Action_URL( Action_Index::SUBMENU_CHANNEL ) ); } return $this->next->handle(); } }