Browse Source

Merge pull request #20858 from nextcloud/fix/20289/remember_webauth_names

Remember the webauthn name of devices
pull/20941/head
Christoph Wurst 6 years ago
committed by GitHub
parent
commit
12fe83cd43
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      lib/private/Authentication/WebAuthn/CredentialRepository.php

4
lib/private/Authentication/WebAuthn/CredentialRepository.php

@ -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());
} }
} }

Loading…
Cancel
Save