mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
chore: Remove gitbeaker dep on client (#11517)
Add dupe detection to gitlab install
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user