mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-29 08:20:21 +05:30
#48: increase token exp safety factor from 1 to 5 min
This commit is contained in:
parent
78132e9adb
commit
9adf91a967
@ -34,7 +34,7 @@ export default function refreshTokenMiddleware({dispatch, getState}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const SAFETY_FACTOR = 60; // ask new token earlier to overcome time dissynchronization problem
|
const SAFETY_FACTOR = 300; // ask new token earlier to overcome time dissynchronization problem
|
||||||
const jwt = getJWTPayload(token);
|
const jwt = getJWTPayload(token);
|
||||||
|
|
||||||
if (jwt.exp - SAFETY_FACTOR < Date.now() / 1000) {
|
if (jwt.exp - SAFETY_FACTOR < Date.now() / 1000) {
|
||||||
|
Loading…
Reference in New Issue
Block a user