浏览代码

fix(user): remove password from context payload if nil

0xJacky 1 周之前
父节点
当前提交
a6fbd2f567
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      api/user/user.go

+ 1 - 0
api/user/user.go

@@ -12,6 +12,7 @@ import (
 
 func encryptPassword(ctx *cosy.Ctx[model.User]) {
 	if ctx.Payload["password"] == nil {
+		delete(ctx.Payload, "password")
 		return
 	}
 	pwd := ctx.Payload["password"].(string)