eyaltoledano/claude-task-master · error · AuthenticationError

INVALID_RESPONSE

INVALID_RESPONSE

Error message

No authorization URL returned

What it means

signInWithPKCE throws AuthenticationError with code INVALID_RESPONSE when the Supabase OAuth initiation succeeds (no error) but the returned data contains no authorization URL. A valid PKCE initiation must produce data.url to redirect the user to.

Source

Thrown at packages/tm-core/src/modules/integration/clients/supabase-client.ts:157

			const { data, error } = await client.auth.signInWithOAuth({
				provider: 'github',
				options: {
					redirectTo:
						process.env.TM_AUTH_CALLBACK_URL ||
						'http://localhost:3421/auth/callback',
					scopes: 'email'
				}
			});

			if (error) {
				throw new AuthenticationError(
					`Failed to initiate PKCE flow: ${error.message}`,
					'PKCE_INIT_FAILED'
				);
			}

			if (!data?.url) {
				throw new AuthenticationError(
					'No authorization URL returned',
					'INVALID_RESPONSE'
				);
			}

			// Extract code_verifier from the URL or generate it
			// Note: Supabase handles PKCE internally, we just need to handle the callback
			return {
				url: data.url,
				codeVerifier: '' // Supabase manages this internally
			};
		} catch (error) {
			if (error instanceof AuthenticationError) {
				throw error;
			}

			throw new AuthenticationError(
				`Failed to start PKCE flow: ${(error as Error).message}`,

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Upgrade @supabase/supabase-js to the latest version
  2. Verify the provider and redirect configuration in Supabase
  3. Catch this error and surface it to the user; retry after fixing config

Example fix

null
Defensive patterns

Strategy: try-catch

Validate before calling

null

Type guard

null

Try / catch

try {
  await client.signInWithPKCE();
} catch (e) {
  if (e instanceof AuthenticationError && e.code === 'INVALID_RESPONSE') {
    // retry once, then surface SDK/config issue to the user
  }
}

Prevention

When it happens

Trigger: Calling signInWithPKCE() and receiving { data: undefined } or { data: { url: undefined } } from signInWithOAuth — typically a client/SDK configuration issue or unexpected provider response.

Common situations: Outdated @supabase/supabase-js versions with changed return shapes, provider misconfiguration returning empty data, or corrupted client initialization.

Related errors


AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29). Data as JSON: /api/errors/f2ccbb24f2235b30. Report an issue: GitHub.