#48: increase token exp safety factor from 1 to 5 min

This commit is contained in:
SleepWalker 2016-11-19 11:51:13 +02:00
parent 78132e9adb
commit 9adf91a967

View File

@ -34,7 +34,7 @@ export default function refreshTokenMiddleware({dispatch, getState}) {
}
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);
if (jwt.exp - SAFETY_FACTOR < Date.now() / 1000) {