added players
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user