{"record":{"id":"224f05c8b61d8730","repo":"medusajs/medusa","slug":"medusa-cloud-does-not-support-registration-use-me","errorCode":null,"errorMessage":"Medusa Cloud does not support registration. Use method `authenticate` instead.","messagePattern":"Medusa Cloud does not support registration\\. Use method `authenticate` instead\\.","errorType":"validation","errorClass":"MedusaError","httpStatus":405,"severity":"error","filePath":"packages/modules/auth/src/providers/medusa-cloud-auth.ts","lineNumber":92,"sourceCode":"        )\n      )\n      return\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      \"Medusa Cloud 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}`,\n      }\n    }","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/modules/auth/src/providers/medusa-cloud-auth.ts#L74-L110","documentation":"The Medusa Cloud auth provider only supports authentication via an external identity provider; it deliberately does not implement registration. Calling its register method always throws NOT_ALLOWED.","triggerScenarios":"Invoking the auth register flow with provider 'medusa-cloud' — e.g. POST /auth/user/medusa-cloud/register or authModuleService.register('medusa-cloud', ...) in a Cloud project or one using this provider.","commonSituations":"Copying an email/passport register route from a self-hosted setup into a Medusa Cloud deployment; generic auth UIs that try every configured provider for registration.","solutions":["Use a different provider (e.g. emailpass) for registration, or disable registration entirely","Call authenticate instead: the identity is created/joined during the Medusa Cloud OAuth callback flow"],"exampleFix":"// before\nawait medusa.auth.register('medusa-cloud', { email, password })\n// after\nawait fetch(`/auth/user/medusa-cloud/authenticate`, { method: 'POST' }) // redirects to Cloud IdP","handlingStrategy":"type-guard","validationCode":"if (provider === 'medusa-cloud') { /* use authenticate, never register */ }","typeGuard":"const supportsRegister = (provider: string) => provider !== 'medusa-cloud'","tryCatchPattern":null,"preventionTips":["Gate registration UI by provider capability","Use emailpass or another provider for registration flows"],"tags":["auth","medusa-cloud","registration"],"backgroundTag":"unsupported-operation","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}