fix: token renewal date
This commit is contained in:
parent
c9a1a1ad40
commit
31661b2cb3
@ -20,6 +20,9 @@ mssql)
|
|||||||
sleep 30
|
sleep 30
|
||||||
docker exec db /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "Password123!" -Q 'CREATE DATABASE wiki'
|
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 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)
|
sqlite)
|
||||||
echo "Using SQLite..."
|
echo "Using SQLite..."
|
||||||
|
@ -114,8 +114,11 @@ module.exports = {
|
|||||||
let mustRevalidate = false
|
let mustRevalidate = false
|
||||||
|
|
||||||
// Expired but still valid within N days, just renew
|
// 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)) {
|
if (info instanceof Error && info.name === 'TokenExpiredError') {
|
||||||
mustRevalidate = true
|
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
|
// Check if user / group is in revocation list
|
||||||
|
Loading…
Reference in New Issue
Block a user