From f5d9cc67600a8b33055e344c12dc0a4c09ef7632 Mon Sep 17 00:00:00 2001 From: maru Date: Thu, 28 Dec 2023 21:09:15 -0500 Subject: [PATCH] Workaround for column name --- db/account.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/account.go b/db/account.go index a2be5d4..73f506c 100644 --- a/db/account.go +++ b/db/account.go @@ -7,7 +7,7 @@ import ( ) func AddAccountRecord(uuid []byte, username string, key, salt []byte) error { - _, err := handle.Exec("INSERT INTO accounts (uuid, username, key, salt, registered) VALUES (?, ?, ?, ?, UTC_TIMESTAMP())", uuid, username, key, salt) + _, err := handle.Exec("INSERT INTO accounts (uuid, username, [key], salt, registered) VALUES (?, ?, ?, ?, UTC_TIMESTAMP())", uuid, username, key, salt) if err != nil { return err } @@ -40,7 +40,7 @@ func GetUsernameFromToken(token []byte) (string, error) { func GetAccountKeySaltFromUsername(username string) ([]byte, []byte, error) { var key, salt []byte - err := handle.QueryRow("SELECT key, salt FROM accounts WHERE username = ?", username).Scan(&key, &salt) + err := handle.QueryRow("SELECT [key], salt FROM accounts WHERE username = ?", username).Scan(&key, &salt) if err != nil { return nil, nil, err }