1
0
Fork 0
mirror of synced 2024-06-01 18:20:18 +12:00

Adding logging for session invalidation.

This commit is contained in:
mike12345567 2022-08-04 16:06:59 +01:00
parent 0257b8cbc9
commit ba7ad93932
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/