diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2018-10-01 16:58:56 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2018-10-01 16:58:56 +0300 |
commit | 3afdfe856cd1754aa07f5afdade29e93f558964a (patch) | |
tree | 375b08f5f643109f6dd44fb84832788c9d6d9a43 /lib | |
parent | 645afb1dcf19a1f4c50c17ed5af61937a221a20a (diff) |
Fix authentication/login registration id missing property
As of https://github.com/Yubico/php-u2flib-server/commit/af674fec3f077c3f447e51696656c6b8ea3b293e, the passed
registrations array is stripped and only u2f properties are returned. Hence, the `id` prop gets removed and
we have to look it up in the original data instead.
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Service/U2FManager.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Service/U2FManager.php b/lib/Service/U2FManager.php index 4c47444..c2d11b1 100644 --- a/lib/Service/U2FManager.php +++ b/lib/Service/U2FManager.php @@ -154,7 +154,10 @@ class U2FManager { return false; } - $registration = $this->mapper->findRegistration($user, $reg->id); + $origReg = reset(array_filter($registrations, function(object $registration) use ($reg) { + return $registration->keyHandle === $reg->keyHandle; + })); + $registration = $this->mapper->findRegistration($user, $origReg->id); $registration->setCounter($reg->counter); $this->mapper->update($registration); return true; |