request = $request; $this->flash = $flash; $this->user_storage = $user_storage; } /** * @inheritDoc */ public function handle() { if ( ! $this->user_storage->is_totp_configured() ) { if ( $this->request->is_ajax() ) { return $this->json( [ 'error' => Notification::get( 'totp-not-configured' ), ], Code::FORBIDDEN ); } $this->flash->add_message( 'error', 'totp-not-configured' ); return $this->redirect( new Action_URL( Action_Index::TWOFAS_ACTION_DEFAULT ) ); } return $this->next->handle(); } }