add client IP to audit logs
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -80,9 +80,10 @@ func DeleteUser(c *gin.Context) {
|
||||
// Create audit record
|
||||
a := models.Audit{
|
||||
UserId: RequestingUserId,
|
||||
IpAddress: c.ClientIP(),
|
||||
EventText: fmt.Sprintf("Deleted User Id %d", testUser.UserId),
|
||||
}
|
||||
a.AutidLogAdd()
|
||||
a.AuditLogAdd()
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{"message": "user deletion success"})
|
||||
}
|
||||
@@ -181,9 +182,10 @@ func AddUser(c *gin.Context) {
|
||||
// Create audit record
|
||||
a := models.Audit{
|
||||
UserId: RequestingUserId,
|
||||
IpAddress: c.ClientIP(),
|
||||
EventText: fmt.Sprintf("Created User Id %d", u.UserId),
|
||||
}
|
||||
a.AutidLogAdd()
|
||||
a.AuditLogAdd()
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{"message": "user registration success", "data": u})
|
||||
}
|
||||
|
Reference in New Issue
Block a user