From f7cb629ec7fb8aca324e6c5081b0bb6cb6a9ab86 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Pailharey?= <rpailharey@grandlyon.com>
Date: Mon, 21 Aug 2023 17:23:19 +0200
Subject: [PATCH] log: verifyUserIdentity

---
 src/core/verifyUserIdentity.js | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/core/verifyUserIdentity.js b/src/core/verifyUserIdentity.js
index 144cc72..3ee35cf 100644
--- a/src/core/verifyUserIdentity.js
+++ b/src/core/verifyUserIdentity.js
@@ -28,8 +28,8 @@ async function verifyUserIdentity(
   isAlternateStart = false,
   inseeCode = ''
 ) {
-  // If first start get InseeCode
   log('debug', 'verifyUserIdentity')
+  // If first start get InseeCode
   if (!isAlternateStart) {
     inseeCode = await getInseeCode(fields.postalCode, fields.city)
   }
@@ -124,7 +124,9 @@ async function verifyUserIdentity(
     }
 
     if (!pdl) {
-      Sentry.captureException('Second chance failed, no pdl found')
+      Sentry.captureException('Second chance failed, no pdl found', {
+        tags: { section: 'verifyUserIdentity' },
+      })
     }
   }
 
@@ -132,10 +134,14 @@ async function verifyUserIdentity(
     log('error', 'PointId does not match')
 
     if (isAlternateStart) {
-      Sentry.captureException('PointId does not match: Alternate start')
+      Sentry.captureException('PointId does not match: Alternate start', {
+        tags: { section: 'verifyUserIdentity' },
+      })
       throw new Error(errors.TERMS_VERSION_MISMATCH)
     } else {
-      Sentry.captureException('PointId does not match')
+      Sentry.captureException('PointId does not match', {
+        tags: { section: 'verifyUserIdentity' },
+      })
       throw new Error(errors.LOGIN_FAILED)
     }
   }
-- 
GitLab