Skip to content

Commit

Permalink
check user email with toLowerCase (#666)
Browse files Browse the repository at this point in the history
#### What problem is this solving?

<!--- What is the motivation and context for this change? -->
Check user email with toLowerCase to prevent error when the identity
user has difference from token

https://vtex-dev.atlassian.net/browse/OMS-6340

#### How to test it?

<!--- Don't forget to add a link to a Workspace where this branch is
linked -->
https://profile--dunnesstorespreprod.myvtex.com/account#/profile
User: [email protected]
Password: Dunnes123 


[Workspace](https://profile--dunnesstorespreprod.myvtex.com/account#/profile)
  • Loading branch information
wagnerlduarte authored Sep 3, 2024
1 parent 4d2c52a commit 3d04b45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion node/directives/withCurrentProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ async function checkUserAccount(
'id' in tokenUser &&
!(
tokenUser.account === account &&
(isUserCallCenterOperator || tokenUser.user === currentProfile?.email)
(isUserCallCenterOperator ||
tokenUser.user.toLowerCase() === currentProfile?.email.toLowerCase())
)
) {
throw new AuthenticationError('')
Expand Down

0 comments on commit 3d04b45

Please sign in to comment.