Remove case sensitivity from emails

This commit is contained in:
Ben Toogood
2021-02-18 12:11:44 +00:00
parent 7932fdbe38
commit eef581b94c
2 changed files with 4 additions and 4 deletions

View File

@@ -97,7 +97,7 @@ func (u *Users) Create(ctx context.Context, req *pb.CreateRequest, rsp *pb.Creat
ID: uuid.New().String(),
FirstName: req.FirstName,
LastName: req.LastName,
Email: req.Email,
Email: strings.ToLower(req.Email),
Password: phash,
}
err = u.DB.Create(user).Error
@@ -184,7 +184,7 @@ func (u *Users) Update(ctx context.Context, req *pb.UpdateRequest, rsp *pb.Updat
user.LastName = req.LastName.Value
}
if req.Email != nil {
user.Email = req.Email.Value
user.Email = strings.ToLower(req.Email.Value)
}
// write the user to the database