{"record":{"id":"a3a6f8f780706089","repo":"medusajs/medusa","slug":"github-callbackurl-is-required","errorCode":null,"errorMessage":"Github callbackUrl is required","messagePattern":"Github callbackUrl is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/modules/providers/auth-github/src/services/github.ts","lineNumber":37,"sourceCode":"\nexport class GithubAuthService extends AbstractAuthModuleProvider {\n  static identifier = \"github\"\n  static DISPLAY_NAME = \"Github Authentication\"\n\n  protected config_: LocalServiceConfig\n  protected logger_: Logger\n\n  static validateOptions(options: GithubAuthProviderOptions) {\n    if (!options.clientId) {\n      throw new Error(\"Github clientId is required\")\n    }\n\n    if (!options.clientSecret) {\n      throw new Error(\"Github clientSecret is required\")\n    }\n\n    if (!options.callbackUrl) {\n      throw new Error(\"Github callbackUrl is required\")\n    }\n  }\n\n  constructor(\n    { logger }: InjectedDependencies,\n    options: GithubAuthProviderOptions\n  ) {\n    // @ts-ignore\n    super(...arguments)\n    this.config_ = options\n    this.logger_ = logger\n  }\n\n  async register(_): Promise<AuthenticationResponse> {\n    throw new MedusaError(\n      MedusaError.Types.NOT_ALLOWED,\n      \"Github does not support registration. Use method `authenticate` instead.\"\n    )","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/modules/providers/auth-github/src/services/github.ts#L19-L55","documentation":"The Github auth provider needs a `callbackUrl` — the URL Github redirects to after authorization — and `validateOptions` throws at startup when it is absent.","triggerScenarios":"Configuring the provider without `callbackUrl`, or building it from an env var like MEDUSA_BACKEND_URL that is undefined.","commonSituations":"Local vs production URL differences, forgetting to set the callback URL env var, or the callbackUrl not matching the one registered in the Github OAuth app.","solutions":["Set callbackUrl in options, e.g. `${BACKEND_URL}/auth/github/${authProviderId}/callback`","Ensure the same URL is registered as the Authorization callback URL in the Github OAuth app settings"],"exampleFix":"// before\noptions: { clientId, clientSecret }\n// after\noptions: { clientId, clientSecret, callbackUrl: `${process.env.MEDUSA_BACKEND_URL}/auth/github/github/callback` }","handlingStrategy":"validation","validationCode":"const callbackUrl = `${process.env.MEDUSA_BACKEND_URL}/auth/github/google/callback`\nif (!process.env.MEDUSA_BACKEND_URL) throw new Error('MEDUSA_BACKEND_URL required for callbackUrl')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Derive callbackUrl from a single BACKEND_URL env var per environment","Register the identical URL in the Github OAuth app"],"tags":["github","oauth","auth-provider","callback-url","startup"],"backgroundTag":"oauth-provider-misconfigured","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}