1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-05 09:10:53 +01:00

allow multiple u2f challenges during 2fa login

This commit is contained in:
Kyle Spearrin 2018-10-10 16:46:57 -04:00
parent 7c3e0cba34
commit 9cd0bd5f7c

View File

@ -98,14 +98,16 @@ export class TwoFactorComponent implements OnInit, OnDestroy {
} }
const challenges = JSON.parse(params.Challenges); const challenges = JSON.parse(params.Challenges);
if (challenges.length > 0) { if (challenges != null && challenges.length > 0) {
this.u2f.init({ this.u2f.init({
appId: challenges[0].appId, appId: challenges[0].appId,
challenge: challenges[0].challenge, challenge: challenges[0].challenge,
keys: [{ keys: challenges.map((c: any) => {
version: challenges[0].version, return {
keyHandle: challenges[0].keyHandle, version: c.version,
}], keyHandle: c.keyHandle,
};
}),
}); });
} }
break; break;