We have switched from using using the VSCode URI to regular URLs, so update the names of the functions to say Url instead of Uri.
17 lines
518 B
TypeScript
17 lines
518 B
TypeScript
import { Empty, EmptyRequest } from "@shared/proto/cline/common"
|
|
import { HostProvider } from "@/hosts/host-provider"
|
|
import { openExternal } from "@/utils/env"
|
|
import { Controller } from ".."
|
|
|
|
/**
|
|
* Initiates OpenRouter auth
|
|
*/
|
|
export async function openrouterAuthClicked(_: Controller, __: EmptyRequest): Promise<Empty> {
|
|
const callbackUrl = await HostProvider.get().getCallbackUrl()
|
|
const authUrl = `https://openrouter.ai/auth?callback_url=${callbackUrl}/openrouter`
|
|
|
|
await openExternal(authUrl)
|
|
|
|
return {}
|
|
}
|