{"record":{"id":"e92c96451161332e","repo":"docusealco/docuseal","slug":"invalid-kba-response","errorCode":null,"errorMessage":"Invalid KBA response","messagePattern":"Invalid KBA response","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"app/javascript/submission_form/kba_step.vue","lineNumber":524,"sourceCode":"          if (data.result.detail === 'NO MATCH') {\n            throw new Error('Unfortunately, we were unable to start Knowledge Based Authentication with the details provided. Please review and confirm that all your personal details are correct.')\n          }\n\n          throw new Error(data.result.detail || 'KBA Start Failed')\n        }\n\n        if (data.output && data.output.questions && data.output.questions.questions) {\n          this.questions = data.output.questions.questions\n          this.token = data.continuations.questions.template.token\n          this.reference = data.meta.reference\n\n          this.questions.forEach(q => {\n            this.answers[q.id] = null\n          })\n\n          this.startCountdown()\n        } else {\n          throw new Error('Invalid KBA response')\n        }\n      } catch (e) {\n        this.error = e.message\n      } finally {\n        this.isLoading = false\n      }\n    },\n    async submit () {\n      this.clearCountdown()\n\n      this.isSubmitting = true\n      this.error = null\n\n      const formattedAnswers = Object.keys(this.answers).reduce((acc, key) => {\n        acc[key] = [this.answers[key]]\n\n        return acc\n      }, {})","sourceCodeStart":506,"sourceCodeEnd":542,"githubUrl":"https://github.com/docusealco/docuseal/blob/004a22c1c88109c7ba0b567df011a8cb13894001/app/javascript/submission_form/kba_step.vue#L506-L542","documentation":"The HTTP call succeeded and no FAIL result was returned, but data.output.questions.questions is absent, so there is no quiz to render. The response shape does not match the component's assumed contract (which also includes data.continuations.questions.template.token and data.meta.reference on the following lines). This indicates provider schema drift, an alternate continuation flow, or an intermediary that altered the body.","triggerScenarios":"Provider schema change renames or moves the questions node; the response carries a different continuation (verification pending on another channel) instead of questions; empty question array; a proxy or test stub returning an incomplete fixture.","commonSituations":"Upgrading the KBA service without updating the frontend; test mocks that only partially implement the response contract; flows where questions are generated asynchronously.","solutions":["Dump the raw JSON of the /api/kba response and diff it against the expected output/continuations structure.","Inspect data.continuations for alternate flows and handle them instead of assuming questions always exist.","Update the parsing (including token/reference extraction) to the current schema.","If a proxy sits in front of the KBA service, verify it passes the provider body through unchanged."],"exampleFix":"// before\nif (data.output && data.output.questions && data.output.questions.questions) {\n  this.questions = data.output.questions.questions\n} else {\n  throw new Error('Invalid KBA response')\n}\n\n// after\nconst questions = data.output?.questions?.questions\nif (!Array.isArray(questions) || questions.length === 0 || !data.continuations?.questions?.template?.token) {\n  throw new Error(`Invalid KBA response: ${JSON.stringify(data.result || {})}`)\n}\nthis.questions = questions","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"function hasKbaQuestions(data) {\n  return Array.isArray(data?.output?.questions?.questions) &&\n    data?.output?.questions?.questions.length > 0 &&\n    typeof data?.continuations?.questions?.template?.token === 'string'\n}","tryCatchPattern":"try {\n  const data = await resp.json()\n  if (!hasKbaQuestions(data)) throw new Error('Invalid KBA response')\n  // ...\n} catch (e) {\n  this.error = e.message\n  console.warn('Unexpected /api/kba payload', data)\n}","preventionTips":["Contract-test the KBA response shape in CI","Pin the provider API version","Log full payloads when shape validation fails"],"tags":["kba","identity-verification","response-shape","schema"],"backgroundTag":"schema-validation-failed","analyzedSha":"004a22c1c88109c7ba0b567df011a8cb13894001","analyzedAt":"2026-08-21T13:38:23.343Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}