chore: Remove gitbeaker dep on client (#11517)

Add dupe detection to gitlab install
This commit is contained in:
Tom Moor
2026-02-22 00:38:10 -05:00
committed by GitHub
parent 46dd13fc7f
commit 496b89c7f8
5 changed files with 24 additions and 67 deletions
+18
View File
@@ -184,6 +184,24 @@ router.get(
customUrl,
});
// Check if another integration already exists with the same installation
const duplicateIntegration = await Integration.findOne({
where: {
service: IntegrationService.GitLab,
teamId: user.teamId,
settings: { gitlab: { installation: { id: userInfo.id } } },
...(existingIntegration
? { id: { [Op.ne]: existingIntegration.id } }
: {}),
},
transaction,
});
if (duplicateIntegration) {
ctx.redirect(GitLabUtils.errorUrl("duplicate_account"));
return;
}
let authentication: IntegrationAuthentication;
if (pendingAuth) {