Obfuscated user passwords when returning a user object
This commit is contained in:
parent
87529b5e3e
commit
80f86527ed
|
@ -97,5 +97,8 @@ func UserAddOrUpdate(c echo.Context) error {
|
||||||
return c.JSON(http.StatusInternalServerError, models.Message{"Could not log."})
|
return c.JSON(http.StatusInternalServerError, models.Message{"Could not log."})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Obfuscate his password
|
||||||
|
newUser.Password = ""
|
||||||
|
|
||||||
return c.JSON(http.StatusOK, newUser)
|
return c.JSON(http.StatusOK, newUser)
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,5 +39,8 @@ func UserShow(c echo.Context) error {
|
||||||
return c.JSON(http.StatusNotFound, models.Message{"User not found."})
|
return c.JSON(http.StatusNotFound, models.Message{"User not found."})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Obfucate his password
|
||||||
|
userInfos.Password = ""
|
||||||
|
|
||||||
return c.JSON(http.StatusOK, userInfos)
|
return c.JSON(http.StatusOK, userInfos)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue