Add getCallUri to the HostProvider (#5322)

**Centralize callback URI management** through the HostProvider instead of having it in multiple places in the codebase.

**Simplify error handling** by making the callback URI required rather than optional

The changes are related to **authentication callback URI handling** in the Cline extension. Here's what's being modified:

  - Simplified callback URI retrieval
- Changed return type from `Promise<string | undefined>` to `Promise<string>`
- Now throws an error if AuthHandler is not enabled instead of returning undefined

- Added a new `getCallbackUri` property that returns a `Promise<string>`
- This allows the host provider to supply callback URIs for authentication

  - Implemented callback URI provider

  - Updated to use HostProvider for callback URI

  - Updated to match new signature
This commit is contained in:
Sarah Fortune authored and GitHub committed 2025-08-05 00:03:07 +01:00
1 parent 8fee09f09e
commit b8227c19c3
7 files changed
+39 -30

No files matched your search

+1
View File
@@ -25,6 +25,7 @@ describe("ClineAPI Core Functionality", () => {
(() => {}) as DiffViewProviderCreator,
vscodeHostBridgeClient,
mockLogToChannel,
async () => "",
)
// Stub the getGlobalState function from the state module
// This is needed because the real createClineAPI uses it for getCustomInstructions