feat (user): add sanitize to hide password for log
This commit is contained in:
@@ -75,3 +75,9 @@ func ToResponseList(users []User) []ResponseDto {
|
||||
}
|
||||
return resp
|
||||
}
|
||||
|
||||
func (c CreateDto) Sanitize() CreateDto {
|
||||
sanitized := c
|
||||
sanitized.Password = "[REDACTED]"
|
||||
return sanitized
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ func Create(input e.CreateDto) (*d.Data, error) {
|
||||
}
|
||||
|
||||
// Start log
|
||||
pl.SetLogInfo(&event, input, "started", "create")
|
||||
pl.SetLogInfo(&event, input.Sanitize(), "started", "create")
|
||||
|
||||
err := dg.I.Transaction(func(tx *gorm.DB) error {
|
||||
mwRunner := newMiddlewareRunner(&event, tx)
|
||||
|
||||
Reference in New Issue
Block a user