fix same ssh key in different teams
This commit is contained in:
parent
36fd0b17ee
commit
a58125cbfe
1 changed files with 5 additions and 7 deletions
|
|
@ -218,13 +218,11 @@ public static function generateFingerprint($privateKey)
|
|||
|
||||
private static function fingerprintExists($fingerprint, $excludeId = null)
|
||||
{
|
||||
$query = self::where('fingerprint', $fingerprint);
|
||||
|
||||
if (! is_null($excludeId)) {
|
||||
$query->where('id', '!=', $excludeId);
|
||||
}
|
||||
|
||||
return $query->exists();
|
||||
return self::query()
|
||||
->where('fingerprint', $fingerprint)
|
||||
->where('team_id', currentTeam()->id)
|
||||
->when($excludeId, fn ($query) => $query->where('id', '!=', $excludeId))
|
||||
->exists();
|
||||
}
|
||||
|
||||
public static function cleanupUnusedKeys()
|
||||
|
|
|
|||
Loading…
Reference in a new issue