From 35faa38b1d2be30823aa6f857e3c352a222ee44b Mon Sep 17 00:00:00 2001 From: Iago Espinoza Date: Fri, 20 Sep 2024 15:35:17 -0300 Subject: [PATCH 1/2] fix: error when no email found in jwt due to email rectification feature --- node/dataSources/identity.ts | 1 + node/directives/withCurrentProfile.ts | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/node/dataSources/identity.ts b/node/dataSources/identity.ts index b9cd4c5ab..0f42e1f8c 100644 --- a/node/dataSources/identity.ts +++ b/node/dataSources/identity.ts @@ -10,6 +10,7 @@ export interface DefaultUser { export interface User extends DefaultUser { id: string user: string + customerId: string account: string audience: string } diff --git a/node/directives/withCurrentProfile.ts b/node/directives/withCurrentProfile.ts index b9ccc522b..57b801c43 100644 --- a/node/directives/withCurrentProfile.ts +++ b/node/directives/withCurrentProfile.ts @@ -261,9 +261,10 @@ async function checkUserAccount( !( tokenUser.account === account && (isUserCallCenterOperator || - tokenUser.user.toLowerCase() === currentProfile?.email.toLowerCase()) + tokenUser.user.toLowerCase() === currentProfile?.email.toLowerCase() || + tokenUser.customerId === currentProfile?.userId) ) ) { - throw new AuthenticationError('') + throw new AuthenticationError('Information conflict in tokenUser') } } From 739bb3632c5b23a92427b12f4726da1c9408ff7c Mon Sep 17 00:00:00 2001 From: Iago Espinoza Date: Fri, 20 Sep 2024 15:49:10 -0300 Subject: [PATCH 2/2] fix: error when no email found in jwt due to email rectification feature --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 633b259ac..24bfc1568 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added +- Validation for customerID due to email rectification ## [2.171.2] - 2024-09-04