Add tickets to db.

This commit is contained in:
2025-03-26 13:26:43 +00:00
parent f001cfe35e
commit 66abdbdd4d
5 changed files with 231 additions and 42 deletions

View File

@@ -55,7 +55,7 @@ func GetUserByID(id int) *User {
}
func LogLoginAttempt(username string, success bool) {
_, err := db.Exec("INSERT INTO login_audit (username, success, timestamp) VALUES (?, ?, ?)",
_, err := db.Exec("INSERT INTO auditlog (username, success, timestamp) VALUES (?, ?, ?)",
username, boolToInt(success), time.Now().Format(time.RFC3339))
if err != nil {
log.Println("❌ Failed to log login:", err)