Fixes query error when disabling all credentials

This commit is contained in:
Bubka
2022-11-11 18:05:43 +01:00
parent af04066dd0
commit ef3ad38a16
2 changed files with 3 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ namespace Laragear\WebAuthn;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Illuminate\Support\Facades\Date;
use JetBrains\PhpStorm\ArrayShape;
use Laragear\WebAuthn\Models\WebAuthnCredential;
use function in_array;
@@ -70,7 +71,7 @@ trait WebAuthnAuthentication
}
});
} else {
$this->webAuthnCredentials()->whereKeyNot($except)->update(['is_enabled' => false]);
$this->webAuthnCredentials()->whereKeyNot($except)->update(['disabled_at' => Date::now()]);
}
}