Skip to content

Commit 25f6ba9

Browse files
fix(credentials): preserve reauthorization outcomes
1 parent 2403a8d commit 25f6ba9

5 files changed

Lines changed: 19 additions & 0 deletions

File tree

apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/connectors-section/connectors-section.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,7 @@ function ConnectorCard({
573573
providerId: providerId!,
574574
preCount: credentials?.length ?? 0,
575575
workspaceId,
576+
reconnect: true,
576577
requestedAt: Date.now(),
577578
})
578579
}
@@ -607,6 +608,7 @@ function ConnectorCard({
607608
providerId: providerId!,
608609
preCount: credentials?.length ?? 0,
609610
workspaceId,
611+
reconnect: true,
610612
requestedAt: Date.now(),
611613
})
612614
}

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/credential-selector/credential-selector.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,7 @@ export function CredentialSelector({
471471
providerId: effectiveProviderId,
472472
preCount: credentials.filter((c) => c.type !== 'service_account').length,
473473
workspaceId,
474+
reconnect: true,
474475
requestedAt: Date.now(),
475476
})
476477
setShowOAuthModal(true)

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/components/tools/credential-selector.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ export function ToolCredentialSelector({
251251
providerId: effectiveProviderId,
252252
preCount: credentials.length,
253253
workspaceId,
254+
reconnect: true,
254255
requestedAt: Date.now(),
255256
})
256257
setShowOAuthModal(true)

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,7 @@ const WorkflowContent = React.memo(
572572
providerId: detail.providerId,
573573
preCount: 0,
574574
workspaceId,
575+
reconnect: true,
575576
requestedAt: Date.now(),
576577
})
577578

apps/sim/hooks/use-oauth-return.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,20 @@ describe('resolveOAuthMessage', () => {
6969
})
7070
})
7171

72+
it('keeps explicit update-access flows on the reconnect success path without a baseline', async () => {
73+
await expect(
74+
resolveOAuthMessage({
75+
...context,
76+
baselineCredentials: undefined,
77+
reconnect: true,
78+
})
79+
).resolves.toEqual({
80+
kind: 'success',
81+
text: '"New Gmail" reconnected successfully.',
82+
})
83+
expect(mocks.requestJson).not.toHaveBeenCalled()
84+
})
85+
7286
it('does not report success when the credential list is unchanged', async () => {
7387
mocks.requireWorkspaceCredentialListResponse.mockReturnValue([
7488
{

0 commit comments

Comments
 (0)