Skip to content

Commit

Permalink
fix: increased timeout to 50 secs
Browse files Browse the repository at this point in the history
  • Loading branch information
yurenju committed Dec 26, 2023
1 parent baa3d20 commit 5b9b22c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions libs/passport-twfido/src/lib/passport-twfido.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,15 @@ Strategy.prototype.authenticate = async function (req) {
try {
let result;
const startTime = Date.now();
const timeout = 20000; // 20 secs
const timeout = 50;

// eslint-disable-next-line no-constant-condition
while (true) {
if (Date.now() - startTime >= timeout) {
throw new TimeoutError('Operation timed out after 20 seconds');
if (Date.now() - startTime >= timeout * 1000) {
return this.fail(
{ message: `Operation timed out after ${timeout} seconds` },
408
);
}

await delay(4000);
Expand Down

0 comments on commit 5b9b22c

Please sign in to comment.