{"record":{"id":"867f7bcda29d5521","repo":"supabase/supabase","slug":"client-endpoint-is-required-867f7b","errorCode":null,"errorMessage":"Client endpoint is required","messagePattern":"Client endpoint is required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/studio/data/oauth-server-apps/oauth-server-app-regenerate-secret-mutation.ts","lineNumber":21,"sourceCode":"\nimport { oauthServerAppKeys } from './keys'\nimport { handleError } from '@/data/fetchers'\nimport { createProjectSupabaseClient } from '@/lib/project-supabase-client'\nimport type { ResponseError, UseCustomMutationOptions } from '@/types'\n\nexport type OAuthServerAppRegenerateSecretVariables = {\n  projectRef: string | undefined\n  clientId: string | undefined\n  clientEndpoint: string | undefined\n}\n\nexport async function regenerateSecret({\n  projectRef,\n  clientEndpoint,\n  clientId,\n}: OAuthServerAppRegenerateSecretVariables) {\n  if (!projectRef) throw new Error('Project reference is required')\n  if (!clientEndpoint) throw new Error('Client endpoint is required')\n  if (!clientId) throw new Error('Oauth app client id is required')\n\n  const supabaseClient = await createProjectSupabaseClient(projectRef, clientEndpoint)\n  const { data, error } = await supabaseClient.auth.admin.oauth.regenerateClientSecret(clientId)\n\n  if (error) handleError(error)\n  return data\n}\n\ntype OAuthAppRegenerateSecretData = Awaited<ReturnType<typeof regenerateSecret>>\n\nexport const useOAuthServerAppRegenerateSecretMutation = ({\n  onSuccess,\n  onError,\n  ...options\n}: Omit<\n  UseCustomMutationOptions<\n    OAuthAppRegenerateSecretData,","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/supabase/supabase/blob/beee91b9c2228dd57302dec75c733baaa84ab543/apps/studio/data/oauth-server-apps/oauth-server-app-regenerate-secret-mutation.ts#L3-L39","documentation":"Second precondition guard in regenerateSecret for clientEndpoint. Required to build the project Supabase client backing the regenerateClientSecret call. Fails fast before any network request.","triggerScenarios":"Regenerate invoked with projectRef present but clientEndpoint undefined, typically because auth settings have not resolved.","commonSituations":"Auth settings still loading; local dev missing the auth endpoint; consumer forgot to thread the endpoint.","solutions":["Pass clientEndpoint from auth settings.","Disable the Regenerate action while clientEndpoint is undefined.","Gate dependent UI on enabled: !!projectRef && !!clientEndpoint."],"exampleFix":"// before\nmutate({ projectRef, clientId })\n// after\nmutate({ projectRef, clientId, clientEndpoint: authSettings?.endpoint })","handlingStrategy":"validation","validationCode":"if (!clientEndpoint) {\n  disableRegenerateButton()\n  return\n}\nmutate({ projectRef, clientEndpoint, clientId })","typeGuard":"const hasClientEndpoint = (\n  v: Partial<OAuthServerAppRegenerateSecretVariables>\n): v is OAuthServerAppRegenerateSecretVariables & { clientEndpoint: string } =>\n  typeof v.clientEndpoint === 'string' && v.clientEndpoint.length > 0","tryCatchPattern":null,"preventionTips":["Pass clientEndpoint from auth settings.","Disable the Regenerate action while clientEndpoint is undefined.","Gate dependent UI on enabled: !!projectRef && !!clientEndpoint."],"tags":["oauth","validation","server-apps","supabase-client"],"backgroundTag":null,"analyzedSha":"beee91b9c2228dd57302dec75c733baaa84ab543","analyzedAt":"2026-08-12T06:51:48.935Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}