timeout when trying u2f again

This commit is contained in:
Kyle Spearrin 2017-07-24 11:52:31 -04:00
parent a7beed334f
commit 55a50fac83
2 changed files with 10 additions and 2 deletions

View File

@ -254,7 +254,10 @@ angular
if (data.errorCode) {
console.log(data.errorCode);
initU2f(challenges);
$timeout(function () {
initU2f(challenges);
}, data.errorCode === 5 ? 0 : 1000);
return;
}

View File

@ -73,9 +73,14 @@ function initU2f(obj) {
if (data.errorCode) {
if (data.errorCode !== 5) {
error('U2F Error: ' + data.errorCode);
setTimeout(function () {
initU2f(obj);
}, 1000)
}
else {
initU2f(obj);
}
initU2f(obj);
return;
}