cline/cline · error

Invalid token exchange response

Error message

Invalid token exchange response

What it means

Error "Invalid token exchange response" thrown in cline/cline.

Source

Thrown at sdk/packages/core/src/auth/cline.ts:270

	refresh_token?: string;
	token_type?: string;
	expires_in?: number;
	error?: string;
	error_description?: string;
};

type WorkOSTokenSuccess = {
	accessToken: string;
	refreshToken: string;
	tokenType: string;
};

function requireClineTokenResponse(
	payload: ClineTokenResponse,
	message: string,
): ClineAuthResponseData {
	if (!payload.success || !payload.data?.accessToken) {
		throw new Error(message);
	}
	return payload.data;
}

async function requestWorkOSDeviceAuthorization(
	clientId: string,
	options?: { requestTimeoutMs?: number },
): Promise<{
	deviceCode: string;
	userCode: string;
	verificationUri: string;
	verificationUriComplete?: string;
	expiresInSeconds: number;
	pollIntervalSeconds: number;
}> {
	const response = await fetch(
		resolveUrl(
			DEFAULT_WORKOS_API_BASE_URL,

View on GitHub (pinned to 491b30b806)

When it happens

Trigger: Thrown at sdk/packages/core/src/auth/cline.ts:270 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of cline/cline@491b30b806 (2026-08-25). Data as JSON: /api/errors/b6ca59d973d8c6d7. Report an issue: GitHub.