From 9cb4dd7fc1eccbba9d4da4916b84d3195c41efd2 Mon Sep 17 00:00:00 2001 From: Randy Schott <1815175+schottra@users.noreply.github.com> Date: Thu, 14 Aug 2025 14:44:22 -0400 Subject: [PATCH] add a little more logging to help debug change email flow --- .../identity-service/src/routes/authentication.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/identity-service/src/routes/authentication.js b/packages/identity-service/src/routes/authentication.js index e4246898aca..62828cbc1c6 100644 --- a/packages/identity-service/src/routes/authentication.js +++ b/packages/identity-service/src/routes/authentication.js @@ -83,6 +83,13 @@ module.exports = function (app) { return errorResponseBadRequest('Invalid credentials') } + if (body.lookupKey === oldLookupKey) { + req.logger.error( + `lookupKey is the same as oldLookupKey: ${body.lookupKey}` + ) + return errorResponseBadRequest('Invalid credentials') + } + // check if new artifacts already exist and are active const newArtifacts = await models.Authentication.findOne({ where: { lookupKey: body.lookupKey } @@ -90,7 +97,9 @@ module.exports = function (app) { if (newArtifacts) { // artifacts passed already exist - req.logger.error('Credentials already exist') + req.logger.error( + `Credentials already exist for lookupKey: ${body.lookupKey}` + ) return errorResponseBadRequest('Invalid credentials') }