{"record":{"id":"ca6b2d5dc6855bc3","repo":"Kong/insomnia","slug":"invalid-type-type-it-must-be-noauth-basic","errorCode":null,"errorMessage":"invalid type (${type}), it must be noauth | basic | bearer | jwt | digest | oauth1 | oauth2 | hawk | awsv4 | ntlm | apikey | edgegrid | asap.","messagePattern":"invalid type \\((.+?)\\), it must be noauth \\| basic \\| bearer \\| jwt \\| digest \\| oauth1 \\| oauth2 \\| hawk \\| awsv4 \\| ntlm \\| apikey \\| edgegrid \\| asap\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/insomnia-scripting-environment/src/objects/auth.ts","lineNumber":338,"sourceCode":"    obj[this.type] = authOption.map(optValue => optValue.toJSON(), {});\n    return obj;\n  }\n\n  update(options: VariableList<Variable> | Variable[] | AuthOptions, type?: AuthOptionTypes) {\n    const currentType = type ? type : this.type;\n    const authOpts = rawOptionsToVariables(options, currentType);\n\n    if (authOpts.length > 0 && authOpts[0]) {\n      this.type = currentType;\n      this.authOptions.set(currentType, authOpts[0]);\n    } else {\n      throw new Error('no valid RequestAuth options is found');\n    }\n  }\n\n  use(type: AuthOptionTypes, options: VariableList<Variable> | Variable[] | AuthOptions) {\n    if (!RequestAuth.isValidType(type)) {\n      throw new Error(\n        `invalid type (${type}), it must be noauth | basic | bearer | jwt | digest | oauth1 | oauth2 | hawk | awsv4 | ntlm | apikey | edgegrid | asap.`,\n      );\n    }\n\n    const authOpts = rawOptionsToVariables(options, type);\n    if (authOpts.length > 0 && authOpts[0]) {\n      this.type = type;\n      this.authOptions.set(type, authOpts[0]);\n    } else {\n      throw new Error('no valid RequestAuth options is found');\n    }\n  }\n}\n\nexport function fromPreRequestAuth(auth: RequestAuth): RequestAuthentication {\n  const authObj = auth.toJSON();\n\n  const findValueInKvArray = (targetKey: string, kvs?: { key: string; value: string }[]) =>","sourceCodeStart":320,"sourceCodeEnd":356,"githubUrl":"https://github.com/Kong/insomnia/blob/d9bb2b0142600f21309832daea3317942d285984/packages/insomnia-scripting-environment/src/objects/auth.ts#L320-L356","documentation":"Error \"invalid type (${type}), it must be noauth | basic | bearer | jwt | digest | oauth1 | oauth2 | hawk | awsv4 | ntlm | apikey | edgegrid | asap.\" thrown in Kong/insomnia.","triggerScenarios":"Thrown at packages/insomnia-scripting-environment/src/objects/auth.ts:338 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d9bb2b0142600f21309832daea3317942d285984","analyzedAt":"2026-08-26T18:04:05.187Z","schemaVersion":2},"datasetVersion":"2026-08-26T21:11:00.512Z"}