From 382a2a3050e801dffdc43d6e4b5d4e08ba29137c Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 4 Aug 2022 16:06:59 +0100 Subject: [PATCH] Adding logging for session invalidation. --- packages/backend-core/src/security/sessions.js | 6 ++++++ packages/cli/.gitignore | 1 + 2 files changed, 7 insertions(+) diff --git a/packages/backend-core/src/security/sessions.js b/packages/backend-core/src/security/sessions.js index 8874b47469..2ac6eefb24 100644 --- a/packages/backend-core/src/security/sessions.js +++ b/packages/backend-core/src/security/sessions.js @@ -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}`) diff --git a/packages/cli/.gitignore b/packages/cli/.gitignore index efef4f97c8..655ef7b624 100644 --- a/packages/cli/.gitignore +++ b/packages/cli/.gitignore @@ -5,3 +5,4 @@ build/ docker-error.log envoy.yaml *.tar.gz +prebuilds/