forked from ebhomengo/niki
🔒fix(delivery): fixed the security problem of the create benefactor kinfboxreq
This commit is contained in:
parent
d829192bd6
commit
aa129a870e
|
@ -10,11 +10,12 @@ import (
|
|||
)
|
||||
|
||||
func (h Handler) Add(c echo.Context) error {
|
||||
claims := claim.GetClaimsFromEchoContext(c)
|
||||
req := param.KindBoxReqAddRequest{BenefactorID: claims.UserID}
|
||||
req := param.KindBoxReqAddRequest{}
|
||||
if bErr := c.Bind(&req); bErr != nil {
|
||||
return echo.NewHTTPError(http.StatusBadRequest)
|
||||
}
|
||||
claims := claim.GetClaimsFromEchoContext(c)
|
||||
req.BenefactorID = claims.UserID
|
||||
|
||||
if fieldErrors, err := h.benefactorKindBoxReqVld.ValidateAddRequest(req); err != nil {
|
||||
msg, code := httpmsg.Error(err)
|
||||
|
|
Loading…
Reference in New Issue