Obfuscated user passwords when returning a user object

This commit is contained in:
kolaente 2018-01-29 15:33:38 +01:00 committed by kolaente
parent 87529b5e3e
commit 80f86527ed
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 6 additions and 0 deletions

View File

@ -97,5 +97,8 @@ func UserAddOrUpdate(c echo.Context) error {
return c.JSON(http.StatusInternalServerError, models.Message{"Could not log."})
}
// Obfuscate his password
newUser.Password = ""
return c.JSON(http.StatusOK, newUser)
}

View File

@ -39,5 +39,8 @@ func UserShow(c echo.Context) error {
return c.JSON(http.StatusNotFound, models.Message{"User not found."})
}
// Obfucate his password
userInfos.Password = ""
return c.JSON(http.StatusOK, userInfos)
}