supabase/supabase · error · Error

Provider identifier is required

Error message

Provider identifier is required

What it means

Third precondition guard in updateOAuthCustomProvider. The identifier selects which custom OAuth provider record is updated by auth.admin.customProviders.updateProvider(identifier, params). With no identifier the SDK cannot target a resource, so the guard fails fast before any network call.

Source

Thrown at apps/studio/data/oauth-custom-providers/oauth-custom-provider-update-mutation.ts:24

import { handleError } from '@/data/fetchers'
import { createProjectSupabaseClient } from '@/lib/project-supabase-client'
import type { ResponseError, UseCustomMutationOptions } from '@/types'

export type OAuthCustomProviderUpdateVariables = UpdateCustomProviderParams & {
  identifier: string | undefined
  projectRef: string | undefined
  clientEndpoint: string | undefined
}

export async function updateOAuthCustomProvider({
  identifier,
  projectRef,
  clientEndpoint,
  ...params
}: OAuthCustomProviderUpdateVariables) {
  if (!projectRef) throw new Error('Project reference is required')
  if (!clientEndpoint) throw new Error('Client endpoint is required')
  if (!identifier) throw new Error('Provider identifier is required')

  const supabaseClient = await createProjectSupabaseClient(projectRef, clientEndpoint)
  const { data, error } = await supabaseClient.auth.admin.customProviders.updateProvider(
    identifier,
    params
  )

  if (error) handleError(error)
  return data!
}

type OAuthCustomProviderUpdateData = Awaited<ReturnType<typeof updateOAuthCustomProvider>>

export const useOAuthCustomProviderUpdateMutation = ({
  onSuccess,
  onError,
  ...options
}: Omit<

View on GitHub (pinned to beee91b9c2)

Solutions

  1. Thread identifier from the selected provider row into the mutation call (e.g. selectedProvider.id).
  2. Disable the Save action until identifier is a non-empty string.
  3. Validate with a type guard on the form payload before calling mutate.

Example fix

// before
mutate({ projectRef, clientEndpoint, ...formValues })
// after
mutate({ identifier: selectedProvider.id, projectRef, clientEndpoint, ...formValues })
Defensive patterns

Strategy: validation

Validate before calling

if (!variables.identifier) {
  setFormError('Select a provider to update')
  return
}
mutate(variables)

Type guard

const hasIdentifier = (
  v: Partial<OAuthCustomProviderUpdateVariables>
): v is OAuthCustomProviderUpdateVariables & { identifier: string } =>
  typeof v.identifier === 'string' && v.identifier.length > 0

Prevention

When it happens

Trigger: The update mutation fires without a selected provider row, e.g. the user triggers Save on a form whose provider context was lost during navigation, or the provider list query returned empty and the edit form rendered anyway.

Common situations: Route param for the provider id is missing or misparsed; UI state was not initialized from the selected row; copy/paste of the mutation call site dropped the identifier argument.

Related errors


AI-assisted analysis of supabase/supabase@beee91b9c2 (2026-08-12). Data as JSON: /api/errors/223ae37010c5a79c. Report an issue: GitHub.