Skip to content

Commit

Permalink
FIX: Use strings.ToLower to match existing email
Browse files Browse the repository at this point in the history
  • Loading branch information
auggod committed Jan 17, 2022
1 parent 169d3e3 commit 42bf3d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"regexp"
"strings"
"time"

uuid "github.com/google/uuid"
Expand All @@ -22,7 +23,7 @@ func (s *Server) AddUser(ctx context.Context, user *pbUser.UserAddRequest) (*pbU
}

err = s.db.NewSelect().Model(&model.User{}).
Where("username = ?", user.Username).
Where("username = ?", strings.ToLower(user.Username)).
Scan(ctx)

if err == nil {
Expand Down

0 comments on commit 42bf3d3

Please sign in to comment.