Adding logging for session invalidation.
This commit is contained in:
parent
ea17cd9a2d
commit
382a2a3050
|
@ -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}`)
|
||||
|
|
|
@ -5,3 +5,4 @@ build/
|
|||
docker-error.log
|
||||
envoy.yaml
|
||||
*.tar.gz
|
||||
prebuilds/
|
||||
|
|
Loading…
Reference in New Issue