Remember the webauthn name of devices

Fixes #20289
we should not reset to default once we have logged in with the device.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2020-05-07 16:13:19 +02:00 committed by backportbot[bot]
parent c37bb7745b
commit 8e9433aee9
1 changed files with 3 additions and 1 deletions

View File

@ -71,7 +71,9 @@ class CredentialRepository implements PublicKeyCredentialSourceRepository {
} catch (IMapperException $e) { } catch (IMapperException $e) {
} }
$defaultName = false;
if ($name === null) { if ($name === null) {
$defaultName = true;
$name = 'default'; $name = 'default';
} }
@ -79,7 +81,7 @@ class CredentialRepository implements PublicKeyCredentialSourceRepository {
if ($oldEntity) { if ($oldEntity) {
$entity->setId($oldEntity->getId()); $entity->setId($oldEntity->getId());
if ($name === null) { if ($defaultName) {
$entity->setName($oldEntity->getName()); $entity->setName($oldEntity->getName());
} }
} }