Skip to content

Commit

Permalink
fix: clear password while get current user
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Jul 10, 2022
1 parent 18b218c commit 8971a92
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/controllers/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit 8971a92

Please sign in to comment.