amend csrf token retries (#16714)
This commit is contained in:
parent
acd5b175ed
commit
a70bb4811c
1 changed files with 5 additions and 2 deletions
|
|
@ -1,5 +1,8 @@
|
|||
/* global Honeybadger */
|
||||
|
||||
const MAX_RETRIES = 30;
|
||||
const RETRY_INTERVAL = 250;
|
||||
|
||||
function getCsrfToken() {
|
||||
var promise = new Promise(function callback(resolve, reject) {
|
||||
var i = 0;
|
||||
|
|
@ -14,7 +17,7 @@ function getCsrfToken() {
|
|||
return resolve(authToken);
|
||||
}
|
||||
|
||||
if (i === 1000) {
|
||||
if (i === MAX_RETRIES) {
|
||||
clearInterval(waitingOnCSRF);
|
||||
Honeybadger.notify(
|
||||
'Could not locate CSRF metatag ' +
|
||||
|
|
@ -22,7 +25,7 @@ function getCsrfToken() {
|
|||
);
|
||||
return reject(new Error('Could not locate CSRF meta tag on the page.'));
|
||||
}
|
||||
}, 5);
|
||||
}, RETRY_INTERVAL);
|
||||
});
|
||||
return promise;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue