fix same ssh key in different teams
This commit is contained in:
@@ -218,13 +218,11 @@ class PrivateKey extends BaseModel
|
|||||||
|
|
||||||
private static function fingerprintExists($fingerprint, $excludeId = null)
|
private static function fingerprintExists($fingerprint, $excludeId = null)
|
||||||
{
|
{
|
||||||
$query = self::where('fingerprint', $fingerprint);
|
return self::query()
|
||||||
|
->where('fingerprint', $fingerprint)
|
||||||
if (! is_null($excludeId)) {
|
->where('team_id', currentTeam()->id)
|
||||||
$query->where('id', '!=', $excludeId);
|
->when($excludeId, fn ($query) => $query->where('id', '!=', $excludeId))
|
||||||
}
|
->exists();
|
||||||
|
|
||||||
return $query->exists();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function cleanupUnusedKeys()
|
public static function cleanupUnusedKeys()
|
||||||
|
|||||||
Reference in New Issue
Block a user