From 8d05d20e6fc9ec8e5768ad2fb4bed20f5b2e0cc4 Mon Sep 17 00:00:00 2001 From: wagnerlduarte Date: Fri, 23 Aug 2024 16:54:53 -0300 Subject: [PATCH 1/3] check user email with toLowerCase --- node/directives/withCurrentProfile.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/node/directives/withCurrentProfile.ts b/node/directives/withCurrentProfile.ts index 6a40cd74..7db2da36 100644 --- a/node/directives/withCurrentProfile.ts +++ b/node/directives/withCurrentProfile.ts @@ -260,7 +260,8 @@ async function checkUserAccount( 'id' in tokenUser && !( tokenUser.account === account && - (isUserCallCenterOperator || tokenUser.user === currentProfile?.email) + (isUserCallCenterOperator || + tokenUser.id.toLowerCase() === currentProfile?.userId.toLowerCase()) ) ) { throw new AuthenticationError('') From 7e50a2180bac72144eeef03fa3d3b92b98d2cbf3 Mon Sep 17 00:00:00 2001 From: wagnerlduarte Date: Fri, 23 Aug 2024 17:04:10 -0300 Subject: [PATCH 2/3] changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cee64f7..4013b272 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Fixed +- Check user email with toLowerCase + ## [2.171.0] - 2024-06-28 ### Fixed From a9d7a00e6d7e8528361044a1d26361cc0a117a74 Mon Sep 17 00:00:00 2001 From: wagnerlduarte Date: Tue, 27 Aug 2024 17:45:58 -0300 Subject: [PATCH 3/3] check email --- node/directives/withCurrentProfile.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/directives/withCurrentProfile.ts b/node/directives/withCurrentProfile.ts index 7db2da36..b9ccc522 100644 --- a/node/directives/withCurrentProfile.ts +++ b/node/directives/withCurrentProfile.ts @@ -261,7 +261,7 @@ async function checkUserAccount( !( tokenUser.account === account && (isUserCallCenterOperator || - tokenUser.id.toLowerCase() === currentProfile?.userId.toLowerCase()) + tokenUser.user.toLowerCase() === currentProfile?.email.toLowerCase()) ) ) { throw new AuthenticationError('')