From e17c03b3e1e121a80b0b22e50db239165c88728f Mon Sep 17 00:00:00 2001 From: Piyush Kumar Date: Wed, 10 Jul 2024 16:23:40 +0530 Subject: [PATCH] update sent mail option while signup and verify --- apps/auth/internal/domain/impl.go | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/apps/auth/internal/domain/impl.go b/apps/auth/internal/domain/impl.go index 0d12e3c09..00af8d286 100644 --- a/apps/auth/internal/domain/impl.go +++ b/apps/auth/internal/domain/impl.go @@ -211,20 +211,11 @@ func (d *domainI) SignUp(ctx context.Context, name string, email string, passwor return nil, errors.NewE(err) } - if _, err := d.commsClient.SendWaitingEmail( - ctx, &comms.WelcomeEmailInput{ - Email: user.Email, - Name: user.Name, - }, - ); err != nil { - d.logger.Errorf(err) + err = d.generateAndSendVerificationToken(ctx, user) + if err != nil { + return nil, errors.NewE(err) } - //err = d.generateAndSendVerificationToken(ctx, user) - //if err != nil { - // return nil, errors.NewE(err) - //} - return newAuthSession(user.Id, user.Email, user.Name, user.Verified, "email/password"), nil } @@ -278,15 +269,7 @@ func (d *domainI) VerifyEmail(ctx context.Context, token string) (*common.AuthSe if err != nil { return nil, errors.NewE(err) } - //if _, err := d.commsClient.SendWelcomeEmail( - // ctx, &comms.WelcomeEmailInput{ - // Email: user.Email, - // Name: user.Name, - // }, - //); err != nil { - // d.logger.Errorf(err) - //} - if _, err := d.commsClient.SendWaitingEmail( + if _, err := d.commsClient.SendWelcomeEmail( ctx, &comms.WelcomeEmailInput{ Email: user.Email, Name: user.Name,