fix: clear password while get current user

This commit is contained in:
Noah Hsu 2022-07-10 17:09:03 +08:00
parent 18b218c6c9
commit 8971a924f1

View File

@ -62,6 +62,7 @@ func Login(c *gin.Context) {
// if token is empty, return guest user
func CurrentUser(c *gin.Context) {
user := c.MustGet("user").(*model.User)
user.Password = ""
common.SuccessResp(c, user)
userResp := *user
userResp.Password = ""
common.SuccessResp(c, userResp)
}