diff --git a/models/user.go b/models/user.go index 02a67ae..b298d90 100644 --- a/models/user.go +++ b/models/user.go @@ -20,6 +20,7 @@ func SetDB(database *sql.DB) { func CreateUser(username, passwordHash string) error { _, err := db.Exec("INSERT INTO users (username, password_hash) VALUES (?, ?)", username, passwordHash) + return err } @@ -34,6 +35,7 @@ func GetUserByUsername(username string) *User { } return nil } + return &user } @@ -48,7 +50,7 @@ func GetUserByID(id int) *User { } return nil } - log.Printf("📦 Looking up user ID %d", id) + return &user } @@ -62,7 +64,9 @@ func LogLoginAttempt(username string, success bool) { func boolToInt(b bool) int { if b { + return 1 } + return 0 }