webauthnServerRepository = $webauthnServerRepository; } public function handle(User $user, ?string $displayName): PublicKeyCredentialCreationOptions { $id = Uuid::uuid4()->toString(); $entity = new PublicKeyCredentialUserEntity($user->uuid, $id, $name ?? $user->email); $excluded = $user->securityKeys->map(function (SecurityKey $key) { return $key->toCredentialsDescriptor(); })->values()->toArray(); $server = $this->webauthnServerRepository->getServer($user); return $server->generatePublicKeyCredentialCreationOptions( $entity, PublicKeyCredentialCreationOptions::ATTESTATION_CONVEYANCE_PREFERENCE_NONE, $excluded ); } }