Skip to content

Commit

Permalink
fix: error when no email found in jwt due to email rectification feature
Browse files Browse the repository at this point in the history
  • Loading branch information
iago1501 authored Oct 16, 2024
1 parent e98a359 commit 24dfa41
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.172.0] - 2024-10-10

Expand Down
1 change: 1 addition & 0 deletions node/dataSources/identity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface DefaultUser {
export interface User extends DefaultUser {
id: string
user: string
customerId: string
account: string
audience: string
}
Expand Down
5 changes: 3 additions & 2 deletions node/directives/withCurrentProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
}

0 comments on commit 24dfa41

Please sign in to comment.