mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-15 12:50:01 +00:00
web/session: add a delta to prevent token expiring on its way to api
This commit is contained in:
parent
9592e59f76
commit
0e461d4ebe
1 changed files with 1 additions and 1 deletions
|
@ -45,7 +45,7 @@ export const getSession = async () => {
|
|||
const currentTime = Math.floor(new Date().getTime() / 1000);
|
||||
const cache = get(cachedSession);
|
||||
|
||||
if (cache?.token && cache?.exp > currentTime) {
|
||||
if (cache?.token && cache?.exp - 2 > currentTime) {
|
||||
return cache;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue