Skip to content
Snippets Groups Projects
Commit 79fe8187 authored by lukasmatusiewicz's avatar lukasmatusiewicz
Browse files

fix multi webauthn

parent ec716800
No related branches found
No related tags found
No related merge requests found
...@@ -184,25 +184,23 @@ class PIResponse ...@@ -184,25 +184,23 @@ class PIResponse
*/ */
public function webAuthnSignRequest() public function webAuthnSignRequest()
{ {
$ret = ""; $arr = [];
$webauthn = "";
foreach ($this->multiChallenge as $challenge) foreach ($this->multiChallenge as $challenge)
{ {
if ($challenge->type === "webauthn") if ($challenge->type === "webauthn")
{ {
$t = json_decode($challenge->webAuthnSignRequest); $t = json_decode($challenge->webAuthnSignRequest);
$t->allowCredentials = null; if (empty($webauthn))
foreach ($this->multiChallenge as $chall)
{ {
if ($chall->type === "webauthn") $webauthn = $t;
{
$t->allowCredentials[] = $chall->attributes['webAuthnSignRequest']['allowCredentials'][0];
}
} }
$ret = json_encode($t); $arr[] = $challenge->attributes['webAuthnSignRequest']['allowCredentials'][0];
break;
} }
} }
return $ret; $webauthn->allowCredentials = $arr;
return json_encode($webauthn);
} }
public function u2fSignRequest() public function u2fSignRequest()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment