diff options
author | 2022-07-03 00:02:37 +0400 | |
---|---|---|
committer | 2022-07-03 00:02:37 +0400 | |
commit | 145b8adde062c4b4e4a0e16ec64fb4427dcd3429 (patch) | |
tree | 43b4b68f963a90266b68ad7e87186956bd4c6f51 /src | |
parent | Merge pull request #474 from python-discord/display-test-failures (diff) | |
parent | Base refresh timeout on diff from current time (diff) |
Merge pull request #477 from python-discord/update-refresh-timeout-logic
Base refresh timeout on diff from current time
Diffstat (limited to 'src')
-rw-r--r-- | src/api/auth.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/api/auth.ts b/src/api/auth.ts index 7f01b9d..de6210e 100644 --- a/src/api/auth.ts +++ b/src/api/auth.ts @@ -204,7 +204,7 @@ export async function refreshBackendJWT(): Promise<boolean> { cookies.set(CookieNames.Username, response.data.username, {sameSite: "strict", secure: PRODUCTION, path: "/", expires: new Date(3000, 1)}); const expiry = Date.parse(response.data.expiry); - setTimeout(refreshBackendJWT, (expiry * 0.9)); + setTimeout(refreshBackendJWT, ((expiry - Date.now()) / 1000 * 0.9)); }).catch(() => { pass = false; cookies.remove(CookieNames.Scopes); |