diff options
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); |