From e8d9ea2dd644fc4ca3f06bbc59f2bcd23aa027d6 Mon Sep 17 00:00:00 2001 From: Lakhan Samani Date: Sat, 24 Aug 2024 09:01:55 +0530 Subject: [PATCH] fix: email login if email not verified Resolves #458 --- server/resolvers/login.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/resolvers/login.go b/server/resolvers/login.go index 89b1ba232..1e3fb2d07 100644 --- a/server/resolvers/login.go +++ b/server/resolvers/login.go @@ -129,6 +129,10 @@ func LoginResolver(ctx context.Context, params model.LoginInput) (*model.AuthRes log.Debug("User email is not verified and email service is not enabled") return res, fmt.Errorf(`email not verified`) } else { + if vreq, err := db.Provider.GetVerificationRequestByEmail(ctx, email, constants.VerificationTypeBasicAuthSignup); err == nil && vreq != nil { + log.Debug("Verification request exists. Please verify email") + return res, fmt.Errorf(`email verification pending`) + } expiresAt := time.Now().Add(1 * time.Minute).Unix() otpData, err := generateOTP(expiresAt) if err != nil {