From 55a50fac83f926de389f10d42673fa699ce96245 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 24 Jul 2017 11:52:31 -0400 Subject: [PATCH] timeout when trying u2f again --- src/app/accounts/accountsLoginController.js | 5 ++++- src/js/u2f-connector.js | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/app/accounts/accountsLoginController.js b/src/app/accounts/accountsLoginController.js index 747d6f7e47..f284c11271 100644 --- a/src/app/accounts/accountsLoginController.js +++ b/src/app/accounts/accountsLoginController.js @@ -254,7 +254,10 @@ angular if (data.errorCode) { console.log(data.errorCode); - initU2f(challenges); + + $timeout(function () { + initU2f(challenges); + }, data.errorCode === 5 ? 0 : 1000); return; } diff --git a/src/js/u2f-connector.js b/src/js/u2f-connector.js index 78d105942a..c09b33fdf8 100644 --- a/src/js/u2f-connector.js +++ b/src/js/u2f-connector.js @@ -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; }