added players

This commit is contained in:
2026-02-16 21:31:02 +11:00
parent fbea6569cf
commit 317fb9a070
17 changed files with 168 additions and 39 deletions

View File

@@ -49,9 +49,6 @@ func log(
if meta.u == nil {
return errors.New("user cannot be nil for audit logging")
}
if meta.r == nil {
return errors.New("request cannot be nil for audit logging")
}
// Convert resourceID to string
var resourceIDStr *string
@@ -70,18 +67,14 @@ func log(
detailsJSON = jsonBytes
}
// Extract IP and User-Agent from request
ipAddress := meta.r.RemoteAddr
userAgent := meta.r.UserAgent()
log := &AuditLog{
UserID: meta.u.ID,
Action: info.Action,
ResourceType: info.ResourceType,
ResourceID: resourceIDStr,
Details: detailsJSON,
IPAddress: ipAddress,
UserAgent: userAgent,
IPAddress: meta.ipAddress,
UserAgent: meta.userAgent,
Result: result,
ErrorMessage: errorMessage,
CreatedAt: time.Now().Unix(),