medusajs/medusa · error · MedusaError

Medusa Cloud does not support registration. Use method `auth

Error message

Medusa Cloud does not support registration. Use method `authenticate` instead.

What it means

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.

Source

Thrown at packages/modules/auth/src/providers/medusa-cloud-auth.ts:92

        )
      )
      return
    }
    if (!header.kid) {
      callback(new Error("ID token is missing 'kid' header"))
      return
    }
    this.jwks_.getSigningKey(header.kid, (err, key) => {
      if (err || !key) {
        callback(err ?? new Error("Unable to resolve signing key"))
        return
      }
      callback(null, key.getPublicKey())
    })
  }

  async register(_): Promise<AuthenticationResponse> {
    throw new MedusaError(
      MedusaError.Types.NOT_ALLOWED,
      "Medusa Cloud does not support registration. Use method `authenticate` instead."
    )
  }

  async authenticate(
    req: AuthenticationInput,
    authIdentityService: AuthIdentityProviderService
  ): Promise<AuthenticationResponse> {
    const query: Record<string, string> = req.query ?? {}
    const body: Record<string, string> = req.body ?? {}

    if (query.error) {
      return {
        success: false,
        error: `${query.error}`,
      }
    }

View on GitHub (pinned to 5e06e544a2)

Solutions

  1. Use a different provider (e.g. emailpass) for registration, or disable registration entirely
  2. Call authenticate instead: the identity is created/joined during the Medusa Cloud OAuth callback flow

Example fix

// before
await medusa.auth.register('medusa-cloud', { email, password })
// after
await fetch(`/auth/user/medusa-cloud/authenticate`, { method: 'POST' }) // redirects to Cloud IdP
Defensive patterns

Strategy: type-guard

Validate before calling

if (provider === 'medusa-cloud') { /* use authenticate, never register */ }

Type guard

const supportsRegister = (provider: string) => provider !== 'medusa-cloud'

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of medusajs/medusa@5e06e544a2 (2026-08-27). Data as JSON: /api/errors/224f05c8b61d8730. Report an issue: GitHub.