fix: token renewal date

pull/2163/head
NGPixel 5 years ago
parent c9a1a1ad40
commit 31661b2cb3

@ -20,6 +20,9 @@ mssql)
sleep 30
docker exec db /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "Password123!" -Q 'CREATE DATABASE wiki'
docker run -d -p 3000:3000 --name wiki --network="host" -e "DB_TYPE=mssql" -e "DB_HOST=localhost" -e "DB_PORT=1433" -e "DB_NAME=wiki" -e "DB_USER=SA" -e "DB_PASS=Password123!" requarks/wiki:canary-$BUILD_BUILDNUMBER
docker logs wiki
sleep 15
docker logs wiki
;;
sqlite)
echo "Using SQLite..."

@ -114,8 +114,11 @@ module.exports = {
let mustRevalidate = false
// Expired but still valid within N days, just renew
if (info instanceof Error && info.name === 'TokenExpiredError' && DateTime.utc().minus(ms(WIKI.config.auth.tokenRenewal)) < DateTime.fromISO(info.expiredAt)) {
mustRevalidate = true
if (info instanceof Error && info.name === 'TokenExpiredError') {
const expiredDate = (info.expiredAt instanceof Date) ? info.expiredAt.toISOString() : info.expiredAt
if (DateTime.utc().minus(ms(WIKI.config.auth.tokenRenewal)) < DateTime.fromISO(expiredDate)) {
mustRevalidate = true
}
}
// Check if user / group is in revocation list

Loading…
Cancel
Save