1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-07-02 16:38:37 +00:00

Make sure username are always lowercase

This commit is contained in:
Frédéric Guillot 2017-12-29 14:55:16 -08:00
parent 038ea790f7
commit 747e3edab3
2 changed files with 9 additions and 7 deletions

View file

@ -50,7 +50,7 @@ func (s *Storage) UserSessions(userID int64) (model.UserSessions, error) {
func (s *Storage) CreateUserSession(username, userAgent, ip string) (sessionID string, err error) {
var userID int64
err = s.db.QueryRow("SELECT id FROM users WHERE username = $1", username).Scan(&userID)
err = s.db.QueryRow("SELECT id FROM users WHERE username = LOWER($1)", username).Scan(&userID)
if err != nil {
return "", fmt.Errorf("unable to fetch UserID: %v", err)
}