Skip to content

Commit

Permalink
Delete Nango Connection id if we don't proceed to update Slack connec…
Browse files Browse the repository at this point in the history
…tion (#2672)
  • Loading branch information
PopDaph authored Nov 24, 2023
1 parent c5d1c7a commit 98811a2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions connectors/src/connectors/slack/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,14 @@ export async function updateSlackConnector(

const newTeamId = teamInfoRes.team.id;
if (newTeamId !== currentSlackConfig.slackTeamId) {
nangoDeleteConnection(connectionId, NANGO_SLACK_CONNECTOR_ID).catch(
(e) => {
logger.error(
{ error: e, connectionId },
"Error deleting Nango connection"
);
}
);
return new Err({
error: {
type: "connector_oauth_target_mismatch",
Expand Down

0 comments on commit 98811a2

Please sign in to comment.