mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
fix relays with same identity repalcing each other, throw error instead
This commit is contained in:
@@ -996,7 +996,9 @@ export const relayServiceFactory = ({
|
||||
);
|
||||
|
||||
if (existingRelay && (existingRelay.host !== host || existingRelay.name !== name)) {
|
||||
return relayDAL.updateById(existingRelay.id, { host, name }, tx);
|
||||
throw new BadRequestError({
|
||||
message: `Machine identity already has an existing relay with the name "${existingRelay.name} and host "${existingRelay.host}". Delete the existing relay or use a different machine identity.`
|
||||
});
|
||||
}
|
||||
|
||||
if (!existingRelay) {
|
||||
|
||||
Reference in New Issue
Block a user