Fix flaw: was able to duplicate user emails because case sensitive check
This commit is contained in:
parent
1038deb225
commit
76981f31c8
1 changed files with 1 additions and 1 deletions
|
|
@ -109,7 +109,7 @@ func UserAdd(c *fiber.Ctx) error {
|
||||||
user.Email = data.Email
|
user.Email = data.Email
|
||||||
|
|
||||||
var usersEmail []models.User
|
var usersEmail []models.User
|
||||||
result := db.Find(&usersEmail, "email = ?", user.Email)
|
result := db.Find(&usersEmail, "LOWER(email) = LOWER(?)", user.Email)
|
||||||
if result.Error != nil {
|
if result.Error != nil {
|
||||||
return result.Error
|
return result.Error
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue