{"record":{"id":"b092db73c73e8973","repo":"medusajs/medusa","slug":"google-callbackurl-is-required","errorCode":null,"errorMessage":"Google callbackUrl is required","messagePattern":"Google callbackUrl is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/modules/providers/auth-google/src/services/google.ts","lineNumber":50,"sourceCode":"export class GoogleAuthService extends AbstractAuthModuleProvider {\n  static identifier = \"google\"\n  static DISPLAY_NAME = \"Google Authentication\"\n\n  protected config_: LocalServiceConfig\n  protected logger_: Logger\n  protected jwks_: JwksClient\n\n  static validateOptions(options: GoogleAuthProviderOptions) {\n    if (!options.clientId) {\n      throw new Error(\"Google clientId is required\")\n    }\n\n    if (!options.clientSecret) {\n      throw new Error(\"Google clientSecret is required\")\n    }\n\n    if (!options.callbackUrl) {\n      throw new Error(\"Google callbackUrl is required\")\n    }\n  }\n\n  constructor(\n    { logger }: InjectedDependencies,\n    options: GoogleAuthProviderOptions\n  ) {\n    // @ts-ignore\n    super(...arguments)\n    this.config_ = options\n    this.logger_ = logger\n    this.jwks_ = jwksClient({\n      jwksUri: GOOGLE_JWKS_URI,\n      cache: true,\n      rateLimit: true,\n    })\n  }\n","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/modules/providers/auth-google/src/services/google.ts#L32-L68","documentation":"The Google auth provider requires the `callbackUrl` — the redirect URI Google sends users back to after consent. `validateOptions` throws at startup if it is absent.","triggerScenarios":"Registering auth-google without callbackUrl, or deriving it from an undefined BACKEND_URL env var.","commonSituations":"Callback URL not registered under 'Authorized redirect URIs' in Google Cloud Console, or local/production URL mismatch.","solutions":["Set callbackUrl in options, e.g. `${BACKEND_URL}/auth/google/google/callback`","Add the exact same URI to the OAuth client's Authorized redirect URIs in Google Cloud Console"],"exampleFix":"// before\noptions: { clientId, clientSecret }\n// after\noptions: { clientId, clientSecret, callbackUrl: `${process.env.MEDUSA_BACKEND_URL}/auth/google/google/callback` }","handlingStrategy":"validation","validationCode":"const googleCallback = `${process.env.MEDUSA_BACKEND_URL}/auth/google/google/callback`\nassertUrlRegisteredInConsole(googleCallback)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use per-environment BACKEND_URL values to build the callback","Keep Authorized redirect URIs in Google Cloud Console in sync"],"tags":["google","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"}