Merge pull request #23 from Bubka/1.x
[1.1.3] FIX: Query error when disabling all credentials
This commit is contained in:
@@ -95,7 +95,7 @@ class WebAuthnCredential extends Model
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $visible = ['id', 'origin', 'alias', 'aaguid', 'attestation_format', 'disabled_at', 'is_enabled'];
|
||||
protected $visible = ['id', 'origin', 'alias', 'aaguid', 'attestation_format', 'disabled_at'];
|
||||
|
||||
/**
|
||||
* @phpstan-ignore-next-line
|
||||
|
||||
@@ -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()]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user