{"record":{"id":"223ae37010c5a79c","repo":"supabase/supabase","slug":"provider-identifier-is-required-223ae3","errorCode":null,"errorMessage":"Provider identifier is required","messagePattern":"Provider identifier is required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/studio/data/oauth-custom-providers/oauth-custom-provider-update-mutation.ts","lineNumber":24,"sourceCode":"import { handleError } from '@/data/fetchers'\nimport { createProjectSupabaseClient } from '@/lib/project-supabase-client'\nimport type { ResponseError, UseCustomMutationOptions } from '@/types'\n\nexport type OAuthCustomProviderUpdateVariables = UpdateCustomProviderParams & {\n  identifier: string | undefined\n  projectRef: string | undefined\n  clientEndpoint: string | undefined\n}\n\nexport async function updateOAuthCustomProvider({\n  identifier,\n  projectRef,\n  clientEndpoint,\n  ...params\n}: OAuthCustomProviderUpdateVariables) {\n  if (!projectRef) throw new Error('Project reference is required')\n  if (!clientEndpoint) throw new Error('Client endpoint is required')\n  if (!identifier) throw new Error('Provider identifier is required')\n\n  const supabaseClient = await createProjectSupabaseClient(projectRef, clientEndpoint)\n  const { data, error } = await supabaseClient.auth.admin.customProviders.updateProvider(\n    identifier,\n    params\n  )\n\n  if (error) handleError(error)\n  return data!\n}\n\ntype OAuthCustomProviderUpdateData = Awaited<ReturnType<typeof updateOAuthCustomProvider>>\n\nexport const useOAuthCustomProviderUpdateMutation = ({\n  onSuccess,\n  onError,\n  ...options\n}: Omit<","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/supabase/supabase/blob/beee91b9c2228dd57302dec75c733baaa84ab543/apps/studio/data/oauth-custom-providers/oauth-custom-provider-update-mutation.ts#L6-L42","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Thread identifier from the selected provider row into the mutation call (e.g. selectedProvider.id).","Disable the Save action until identifier is a non-empty string.","Validate with a type guard on the form payload before calling mutate."],"exampleFix":"// before\nmutate({ projectRef, clientEndpoint, ...formValues })\n// after\nmutate({ identifier: selectedProvider.id, projectRef, clientEndpoint, ...formValues })","handlingStrategy":"validation","validationCode":"if (!variables.identifier) {\n  setFormError('Select a provider to update')\n  return\n}\nmutate(variables)","typeGuard":"const hasIdentifier = (\n  v: Partial<OAuthCustomProviderUpdateVariables>\n): v is OAuthCustomProviderUpdateVariables & { identifier: string } =>\n  typeof v.identifier === 'string' && v.identifier.length > 0","tryCatchPattern":null,"preventionTips":["Initialize the form's identifier from the selected provider row or route param.","Disable Save when no provider is selected.","Render the edit form only after a provider has been chosen."],"tags":["oauth","validation","custom-providers","typescript"],"backgroundTag":null,"analyzedSha":"beee91b9c2228dd57302dec75c733baaa84ab543","analyzedAt":"2026-08-12T06:51:48.935Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}