fix(kiro): minor OAuth social exchange tweaks (#3176)

Kiro social OAuth: optional targetProvider passthrough. Integrated into release/v3.8.10.
This commit is contained in:
PizzaV
2026-06-04 23:10:31 +02:00
committed by GitHub
parent 0ff8949dc5
commit 17ea178dc8
3 changed files with 7 additions and 3 deletions

View File

@@ -11,6 +11,7 @@ import { KIRO_CONFIG } from "@/lib/oauth/constants/oauth";
const socialExchangeSchema = z.object({
deviceCode: z.string().min(1, "Missing deviceCode or provider"),
provider: z.string().min(1, "Missing deviceCode or provider"),
targetProvider: z.string().optional(),
});
/**
@@ -47,7 +48,7 @@ export async function POST(request: Request) {
}
try {
const { deviceCode, provider } = validation.data;
const { deviceCode, provider, targetProvider } = validation.data;
const response = await fetch(KIRO_CONFIG.socialDevicePollUrl, {
method: "POST",
@@ -84,7 +85,7 @@ export async function POST(request: Request) {
}
const connection: any = await createProviderConnection({
provider: "kiro",
provider: targetProvider || "kiro",
authType: "oauth",
accessToken: data.accessToken,
refreshToken: data.refreshToken,

View File

@@ -104,6 +104,7 @@ export default function KiroOAuthWrapper({
<KiroSocialOAuthModal
isOpen={isOpen}
provider={socialProvider}
targetProvider={oauthProviderId}
providerLabel={providerLabel}
onSuccess={handleSocialSuccess}
onClose={handleBack}

View File

@@ -8,6 +8,7 @@ import { copyToClipboard } from "@/shared/utils/clipboard";
type KiroSocialOAuthModalProps = {
isOpen: boolean;
provider: "google" | "github";
targetProvider?: string;
providerLabel?: string;
onSuccess?: () => void;
onClose: () => void;
@@ -16,6 +17,7 @@ type KiroSocialOAuthModalProps = {
export default function KiroSocialOAuthModal({
isOpen,
provider,
targetProvider,
providerLabel = "Kiro",
onSuccess,
onClose,
@@ -51,7 +53,7 @@ export default function KiroSocialOAuthModal({
const pollRes = await fetch("/api/oauth/kiro/social-exchange", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ deviceCode: data.deviceCode, provider }),
body: JSON.stringify({ deviceCode: data.deviceCode, provider, targetProvider }),
});
const pollData = await pollRes.json();