{"record":{"id":"9f7cba82eeb3bffb","repo":"anomalyco/sst","slug":"auth-issuer-field-must-be-set","errorCode":null,"errorMessage":"Auth: issuer field must be set","messagePattern":"Auth: issuer field must be set","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"platform/src/components/aws/auth.ts","lineNumber":314,"sourceCode":"        _hint: self.url,\n      });\n    }\n\n    function createTable() {\n      return new Dynamo(\n        `${name}Storage`,\n        {\n          fields: { pk: \"string\", sk: \"string\" },\n          primaryIndex: { hashKey: \"pk\", rangeKey: \"sk\" },\n          ttl: \"expiry\",\n        },\n        { parent: self },\n      );\n    }\n\n    function createIssuer() {\n      const fn = args.authorizer || args.issuer;\n      if (!fn) throw new Error(\"Auth: issuer field must be set\");\n      return functionBuilder(\n        `${name}Issuer`,\n        fn,\n        {\n          link: [table],\n          environment: {\n            OPENAUTH_STORAGE: jsonStringify({\n              type: \"dynamo\",\n              options: { table: table.name },\n            }),\n          },\n          _skipHint: true,\n        },\n        (args) => {\n          args.url = {\n            ...(typeof args.url === \"object\" ? args.url : {}),\n            cors: false,\n          };","sourceCodeStart":296,"sourceCodeEnd":332,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/aws/auth.ts#L296-L332","documentation":"The Auth component's `createIssuer` builds the issuer function used to authenticate requests. It requires either `args.authorizer` or `args.issuer` to be set; if neither is provided there is no way to construct the auth handler, so it throws immediately. This is a developer configuration error caught at definition time.","triggerScenarios":"Creating `new sst.aws.Auth(...)` without passing either `issuer` or `authorizer` in the args object.","commonSituations":"Forgotten `issuer` callback after refactoring auth config; copying a boilerplate Auth component without filling in the issuer function; typo'd property name (e.g. `issuers` instead of `issuer`).","solutions":["Add an `issuer` function to the Auth args that returns a session payload","Pass an `authorizer` function instead if you need full control over authentication","Check for typos in the args key names (`issuer`/`authorizer`)"],"exampleFix":"// before\nconst auth = new sst.aws.Auth(\"Auth\", {});\n// after\nconst auth = new sst.aws.Auth(\"Auth\", {\n  issuer: {\n    handler: \"src/auth/issuer.handler\",\n  },\n});","handlingStrategy":"validation","validationCode":"const authArgs = { issuer: { handler: \"src/auth/issuer.handler\" } };\nif (!authArgs.issuer && !authArgs.authorizer) {\n  throw new Error(\"Auth requires issuer or authorizer\");\n}\nnew sst.aws.Auth(\"Auth\", authArgs);","typeGuard":"function hasAuthTarget(a: { issuer?: unknown; authorizer?: unknown }): a is { issuer: NonNullable<unknown> } & typeof a {\n  return Boolean(a.issuer || a.authorizer);\n}","tryCatchPattern":"try {\n  const auth = new sst.aws.Auth(\"Auth\", args);\n} catch (e) {\n  if ((e as Error).message.includes(\"issuer field must be set\")) {\n    throw new Error(\"Add issuer or authorizer to Auth args\");\n  }\n  throw e;\n}","preventionTips":["Always set `issuer` (or `authorizer`) when creating an Auth component","Use a shared typed factory function for Auth args so required fields can't be omitted","Double-check property spelling after refactoring auth config"],"tags":["aws","auth","missing-config"],"backgroundTag":"missing-required-config","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}