public function securityKeyAction(): Action
{
$name = \App\Services\TwoFactorService::SECURITY_KEY_METHOD;
return Action::make("securitykey")
->label("Register new key")
->icon('heroicon-c-plus-circle')
->color('success')
->hidden(function () use ($name) {
return $this->config['methods'][$name]['enabled'] ? false : true;
})
->extraAttributes(['x-data' => 'registerPasskey', 'x-show' => 'browserSupportsWebAuthn()'])
->alpineClickHandler('register("' . Str::random(10) . '")');
}
public function securityKeyAction(): Action
{
$name = \App\Services\TwoFactorService::SECURITY_KEY_METHOD;
return Action::make("securitykey")
->label("Register new key")
->icon('heroicon-c-plus-circle')
->color('success')
->hidden(function () use ($name) {
return $this->config['methods'][$name]['enabled'] ? false : true;
})
->extraAttributes(['x-data' => 'registerPasskey', 'x-show' => 'browserSupportsWebAuthn()'])
->alpineClickHandler('register("' . Str::random(10) . '")');
}