Skip to content

Commit

Permalink
fix: email login if email not verified
Browse files Browse the repository at this point in the history
Resolves #458
  • Loading branch information
lakhansamani committed Aug 24, 2024
1 parent 70f2de7 commit e8d9ea2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/resolvers/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit e8d9ea2

Please sign in to comment.