Procházet zdrojové kódy

fix(core): Fix email verification for already-verified accounts (#1304)

Fixes #1303
Harun Kilic před 4 roky
rodič
revize
2f17b9a1fd

+ 2 - 4
packages/core/src/service/services/customer.service.ts

@@ -424,11 +424,9 @@ export class CustomerService {
      */
     async refreshVerificationToken(ctx: RequestContext, emailAddress: string): Promise<void> {
         const user = await this.userService.getUserByEmailAddress(ctx, emailAddress);
-        if (user) {
+        if (user && !user.verified) {
             await this.userService.setVerificationToken(ctx, user);
-            if (!user.verified) {
-                this.eventBus.publish(new AccountRegistrationEvent(ctx, user));
-            }
+            this.eventBus.publish(new AccountRegistrationEvent(ctx, user));
         }
     }