diff --git a/src/cli.ts b/src/cli.ts index a09a9f1..af671e9 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -88,6 +88,7 @@ async function main() { id: item.id, name: item.name, sourceType: item.source.type, + provider: (item.source as any).provider ?? item.source.type, current: item.id === currentCorpId }))); return; @@ -98,7 +99,8 @@ async function main() { printJson({ id: corp.id, name: corp.name, - sourceType: corp.source.type + sourceType: corp.source.type, + provider: (corp.source as any).provider ?? corp.source.type }); return; } @@ -688,6 +690,10 @@ async function addSealCorp(input: Record) { stringValue(remoteUser?.id) ?? "seal"; + const provider = optionalString(input, "provider") ?? + stringValue(remoteUser?.provider) ?? + stringValue((remoteTenant as any)?.providerConfig?.provider); + const config: CorpConfig = { id, name: tenantName ?? id, @@ -708,7 +714,8 @@ async function addSealCorp(input: Record) { tenantId, tenantSlug, tenantName, - providerUserId: stringValue(remoteUser?.providerUserId) + providerUserId: stringValue(remoteUser?.providerUserId), + provider }, auth: { refreshTtl: 300 diff --git a/src/core/config/types.ts b/src/core/config/types.ts index 8cd2c4e..72266b2 100644 --- a/src/core/config/types.ts +++ b/src/core/config/types.ts @@ -47,7 +47,9 @@ export const NativeSealSourceSchema = z.object({ tenantId: z.string().optional(), tenantSlug: z.string().optional(), tenantName: z.string().optional(), - providerUserId: z.string().optional() + providerUserId: z.string().optional(), + provider: z.string().optional(), + providerName: z.string().optional() }); export const SealSourceSchema = z.discriminatedUnion("type", [