fixes Refresh Token UI incorrectly discarding expired (but refreshable) temp tokens
This commit is contained in:
parent
0418951928
commit
7d517a4c5f
|
@ -88,16 +88,11 @@
|
||||||
const data = JSON.parse(existingToken);
|
const data = JSON.parse(existingToken);
|
||||||
const { token, expires } = data;
|
const { token, expires } = data;
|
||||||
const expiresDate = new Date(expires);
|
const expiresDate = new Date(expires);
|
||||||
const now = new Date();
|
|
||||||
if (expiresDate > now) {
|
|
||||||
document.getElementById(
|
document.getElementById(
|
||||||
"existing-token-value"
|
"existing-token-value"
|
||||||
).textContent = `Your token: ${token} (valid until ${expiresDate.toLocaleString()})`;
|
).textContent = `Your token: ${token} (valid until ${expiresDate.toLocaleString()})`;
|
||||||
document.getElementById("existing-token").style.display = "block";
|
document.getElementById("existing-token").style.display = "block";
|
||||||
document.getElementById("refresh-token").disabled = false;
|
document.getElementById("refresh-token").disabled = false;
|
||||||
} else {
|
|
||||||
localStorage.removeItem("captcha-temp-token");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const proxyKey = localStorage.getItem("captcha-proxy-key");
|
const proxyKey = localStorage.getItem("captcha-proxy-key");
|
||||||
|
|
Loading…
Reference in New Issue