fix: escape 'key' as reserved word in all MySQL queries with backticks
This commit is contained in:
+1
-1
@@ -126,7 +126,7 @@ func (h *AuthHandler) HandleRegister(c *gin.Context) {
|
||||
|
||||
// Seed default settings for the user
|
||||
for key, val := range defaultUserSettings {
|
||||
h.db.Exec(`INSERT IGNORE INTO user_settings (user_id, key, value) VALUES (?, ?, ?)`, userID, key, val)
|
||||
h.db.Exec("INSERT IGNORE INTO user_settings (user_id, `key`, value) VALUES (?, ?, ?)", userID, key, val)
|
||||
}
|
||||
|
||||
// Auto-login: set session
|
||||
|
||||
Reference in New Issue
Block a user