{"record":{"id":"b42fbf235be60255","repo":"medusajs/medusa","slug":"google-does-not-support-registration-use-method","errorCode":null,"errorMessage":"Google does not support registration. Use method `authenticate` instead.","messagePattern":"Google does not support registration\\. Use method `authenticate` instead\\.","errorType":"exception","errorClass":"MedusaError","httpStatus":403,"severity":"error","filePath":"packages/modules/providers/auth-google/src/services/google.ts","lineNumber":87,"sourceCode":"  protected getSigningKey_ = (\n    header: JwtHeader,\n    callback: (err: Error | null, key?: string) => void\n  ) => {\n    if (!header.kid) {\n      callback(new Error(\"ID token is missing 'kid' header\"))\n      return\n    }\n    this.jwks_.getSigningKey(header.kid, (err, key) => {\n      if (err || !key) {\n        callback(err ?? new Error(\"Unable to resolve signing key\"))\n        return\n      }\n      callback(null, key.getPublicKey())\n    })\n  }\n\n  async register(_): Promise<AuthenticationResponse> {\n    throw new MedusaError(\n      MedusaError.Types.NOT_ALLOWED,\n      \"Google does not support registration. Use method `authenticate` instead.\"\n    )\n  }\n\n  async authenticate(\n    req: AuthenticationInput,\n    authIdentityService: AuthIdentityProviderService\n  ): Promise<AuthenticationResponse> {\n    const query: Record<string, string> = req.query ?? {}\n    const body: Record<string, string> = req.body ?? {}\n\n    if (query.error) {\n      return {\n        success: false,\n        error: `${query.error_description}, read more at: ${query.error_uri}`,\n      }\n    }","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/modules/providers/auth-google/src/services/google.ts#L69-L105","documentation":"Google's OAuth flow only supports sign-in, not account creation. The `register` method on the Google auth provider always throws a NOT_ALLOWED MedusaError by design.","triggerScenarios":"A client calling `/auth/customer/google/register` or `authProvider.register(...)` for the google provider.","commonSituations":"Generic sign-up flows that call register for every configured provider, or assuming the auth provider interface's register is implemented everywhere.","solutions":["Use the authenticate flow for Google sign-ins","Skip the register step for OAuth providers in shared auth UI"],"exampleFix":"// before\nawait sdk.auth.register('customer', 'google', {})\n// after\nawait sdk.auth.authenticate('customer', 'google', {})","handlingStrategy":"try-catch","validationCode":"const supportsRegister = (providerId: string) => !['github', 'google'].includes(providerId)","typeGuard":null,"tryCatchPattern":"try { await provider.register(payload) } catch (e) { if (e.type === 'not_allowed') { await provider.authenticate(payload) } else throw e }","preventionTips":["Route OAuth providers directly to authenticate","Hide 'register' buttons for social login providers"],"tags":["google","oauth","not-allowed","auth-provider"],"backgroundTag":"oauth-unsupported-operation","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}