[server] convert email to lowerCase

This commit is contained in:
Neeraj Gupta 2024-05-08 20:35:21 +05:30
parent d69ff79a67
commit 316473f5cf

View file

@ -194,8 +194,8 @@ func (repo *UserRepository) UpdateEmail(userID int64, encryptedEmail ente.Encryp
// GetUserIDWithEmail returns the userID associated with a provided email
func (repo *UserRepository) GetUserIDWithEmail(email string) (int64, error) {
trimmedEmail := strings.TrimSpace(email)
emailHash, err := crypto.GetHash(trimmedEmail, repo.HashingKey)
sanitizedEmail := strings.ToLower(strings.TrimSpace(email))
emailHash, err := crypto.GetHash(sanitizedEmail, repo.HashingKey)
if err != nil {
return -1, stacktrace.Propagate(err, "")
}