Browse Source

fix(core): Make verifyCustomerAccount channel-independent (#945)

Karel Van De Winkel 4 years ago
parent
commit
39b3937959
1 changed files with 6 additions and 1 deletions
  1. 6 1
      packages/core/src/service/services/customer.service.ts

+ 6 - 1
packages/core/src/service/services/customer.service.ts

@@ -376,10 +376,15 @@ export class CustomerService {
         if (isGraphQlErrorResult(result)) {
             return result;
         }
-        const customer = await this.findOneByUserId(ctx, result.id);
+        const customer = await this.findOneByUserId(ctx, result.id, false);
         if (!customer) {
             throw new InternalServerError('error.cannot-locate-customer-for-user');
         }
+        if (ctx.channelId) {
+            await this.channelService.assignToChannels(ctx, Customer, customer.id, [
+                ctx.channelId,
+            ]);
+        }
         await this.historyService.createHistoryEntryForCustomer({
             customerId: customer.id,
             ctx,