Fix authentication/login registration id missing property

As of af674fec3f, 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>
This commit is contained in:
Christoph Wurst 2018-10-01 15:58:56 +02:00
Родитель 645afb1dcf
Коммит 3afdfe856c
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -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;