Skip to content

Commit e15aea9

Browse files
authored
Merge pull request #787 from tomasz-kusy/issue-786
feat: expose hide_existing_credentials in bundle registration section (#786)
1 parent 230adc5 commit e15aea9

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

.ci-tools/phpstan-baseline.neon

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,12 @@ parameters:
543543
count: 2
544544
path: ../src/symfony/src/DependencyInjection/Factory/Security/WebauthnFactory.php
545545

546+
-
547+
rawMessage: Cannot access offset 'hide_existing_credentials' on mixed.
548+
identifier: offsetAccess.nonOffsetAccessible
549+
count: 1
550+
path: ../src/symfony/src/DependencyInjection/Factory/Security/WebauthnFactory.php
551+
546552
-
547553
rawMessage: Cannot access offset 'host' on mixed.
548554
identifier: offsetAccess.nonOffsetAccessible
@@ -711,6 +717,12 @@ parameters:
711717
count: 1
712718
path: ../src/symfony/src/DependencyInjection/Factory/Security/WebauthnFactory.php
713719

720+
-
721+
rawMessage: 'Parameter #10 $hideExistingCredentials of method Webauthn\Bundle\DependencyInjection\Factory\Security\WebauthnFactory::createAttestationRequestControllerAndRoute() expects bool, mixed given.'
722+
identifier: argument.type
723+
count: 1
724+
path: ../src/symfony/src/DependencyInjection/Factory/Security/WebauthnFactory.php
725+
714726
-
715727
rawMessage: 'Parameter #3 $config of method Webauthn\Bundle\DependencyInjection\Factory\Security\WebauthnFactory::getAssertionOptionsBuilderId() expects array<mixed>, mixed given.'
716728
identifier: argument.type

src/symfony/src/DependencyInjection/Factory/Security/WebauthnFactory.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ public function addConfiguration(NodeDefinition $builder): void
176176
->arrayNode('registration')
177177
->canBeEnabled()
178178
->children()
179+
->booleanNode('hide_existing_credentials')
180+
->defaultTrue()
181+
->end()
179182
->scalarNode('profile')
180183
->defaultValue('default')
181184
->end()
@@ -347,6 +350,7 @@ private function createAttestationControllersAndRoutes(
347350
$config['options_storage'],
348351
$config['registration']['options_handler'],
349352
$config['failure_handler'],
353+
$config['registration']['hide_existing_credentials'],
350354
);
351355
if ($config['registration']['routes']['result_path'] !== null) {
352356
$this->createResponseControllerAndRoute(
@@ -401,6 +405,7 @@ private function createAttestationRequestControllerAndRoute(
401405
null|string $optionsStorageId,
402406
string $optionsHandlerId,
403407
string $failureHandlerId,
408+
bool $hideExistingCredentials,
404409
): void {
405410
$controller = (new Definition(AttestationRequestController::class))
406411
->setFactory([new Reference(AttestationControllerFactory::class), 'createRequestController'])
@@ -410,7 +415,7 @@ private function createAttestationRequestControllerAndRoute(
410415
new Reference($optionsStorageId ?? OptionsStorage::class),
411416
new Reference($optionsHandlerId),
412417
new Reference($failureHandlerId),
413-
true,
418+
$hideExistingCredentials,
414419
]);
415420
$this->createControllerAndRoute(
416421
$container,

0 commit comments

Comments
 (0)