Adding logging for session invalidation.

This commit is contained in:
mike12345567 2022-08-04 16:06:59 +01:00
parent ea17cd9a2d
commit 382a2a3050
2 changed files with 7 additions and 0 deletions

View File

@ -1,5 +1,6 @@
const redis = require("../redis/init")
const { v4: uuidv4 } = require("uuid")
const { logWarn } = require("../logging")
// a week in seconds
const EXPIRY_SECONDS = 86400 * 7
@ -38,6 +39,11 @@ async function invalidateSessions(userId, sessionIds = null) {
for (let session of sessions) {
promises.push(client.delete(session.key))
}
logWarn(
`Invalidating sessions for ${userId} - ${sessions
.map(session => session.key)
.join(", ")}`
)
await Promise.all(promises)
} catch (err) {
console.error(`Error invalidating sessions: ${err}`)

View File

@ -5,3 +5,4 @@ build/
docker-error.log
envoy.yaml
*.tar.gz
prebuilds/