-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: error when no email found in jwt due to email rectification feature #673
Conversation
Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖 Please select which version do you want to release:
And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.
|
Beep boop 🤖 I noticed you didn't make any changes at the
In order to keep track, I'll create an issue if you decide now is not a good time
|
@@ -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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iago1501 caso não tenha customerId (caso geral), e o currentProfile seja nulo, vai dar verdadeiro?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isso @rafaelnader , é que a lógica desse cara foi feita invertida, também fiquei confuso pra entender.
No teu exemplo, esse condicional de dentro vai dar false, mas tem o bang (!) antes pra inverter e dar verdadeiro, e daí, ele vai disparar o erro porque esse condicional é para disparar o erro.
Basicamente tudo o que ta dentro do parêntese é esperado que retorne true pra ele retornar false e não cair no erro 😵💫
Essa foi sua dúvida?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Your PR has been merged! App is being published. 🚀 After the publishing process has been completed (check #vtex-io-releases) and doing A/B tests with the new version, you can deploy your release by running:
After that your app will be updated on all accounts. For more information on the deployment process check the docs. 📖 |
What problem is this solving?
Now it's possible to navigate at VTEX without email, it's a new feature called email rectification. In this scenario, the validation must be done by the customerId. From now on, every user will have their own customerId and it's supposed to not use email as a primary key anymore
How to test it?
You must follow several steps in order to create your user with the permissions, so, when reviewing this, please, contact to me so I can give you the access
Before
After
How does this PR make you feel? 🔗