From 6d43965c1f19bf1926afc6552d5283381bc3f5ce Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 18 Jul 2020 07:56:42 -0400 Subject: [PATCH] two more --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 3b981a2..710a1b9 100644 --- a/main.go +++ b/main.go @@ -58,7 +58,7 @@ func UsernameAvailable(username string) bool { var tmp string u := strings.ToLower(username) - q := fmt.Sprintf("select username from %s_auth where username ILIKE $1", c.TablePrefix) + q := fmt.Sprintf("select username from %s_auth where username = $1", c.TablePrefix) err := c.db.Get(&tmp, q, u) if err == sql.ErrNoRows { return true @@ -95,8 +95,8 @@ func Register(username, email, ip string) bool { return true } log.Printf("scsusers.Register: Failed to send registration email, deleting user %s\n", username) - q = fmt.Sprintf("delete from %s_auth where username ILIKE $1 AND password=$2", c.TablePrefix) - _, err = c.db.Exec(q, username, string(crypt)) + q = fmt.Sprintf("delete from %s_auth where username = $1 AND password=$2", c.TablePrefix) + _, err = c.db.Exec(q, u, string(crypt)) if err != nil { log.Printf("scsusers.Register: Failed to delete new user %s: %s\n", username, err.Error()) }