-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
type: bug 🐛Something isn't workingSomething isn't working
Description
Describe the bug
Consider the following two scenarios:
- User is making a Guest-Order and becomes a Customer entity with email a@b.com
- No User entity is created for guest orders
- Another user is now registering with a@b.com and gets verified by an external authority
- A second Customer entity is correctly created
- A User entity is created, associated with the newly created customer and email verified
It's correct that two Customer entities exist in parallel as the first could have been a typo in the guest order, but the first customer should not be marked as verified in the Admin Dashboard.
The verification check is based on a email lookup of the user rather than the direct user-customer relationship
@michaelbromley The implementation appears intentional, but the reasoning behind it is unclear to me in customer-entity.resolver.ts:
@ResolveField()
user(@Ctx() ctx: RequestContext, @Parent() customer: Customer) {
if (customer.user) {
return customer.user;
}
return this.userService.getUserByEmailAddress(ctx, customer.emailAddress, 'customer');
}Why not just return customer.user; and if undefined the customer is not verified?
At least it is misleading, as of cause that email address is verfified but the specific customer is not.
Metadata
Metadata
Assignees
Labels
type: bug 🐛Something isn't workingSomething isn't working