mirror of
https://github.com/KaySar12/NextZen-UserService.git
synced 2025-10-06 19:59:42 +07:00
Merge pull request from GHSA-c967-2652-gfjm
* fix: fix username enumeration * fix typo msg type * fix: recovery error patch * fix: recovery error patch --------- Signed-off-by: CorrectRoadH <a778917369@gmail.com>
This commit is contained in:
+2
-2
@@ -116,7 +116,7 @@ func PostUserLogin(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
if user.Password != encryption.GetMD5ByStr(password) {
|
if user.Password != encryption.GetMD5ByStr(password) {
|
||||||
c.JSON(common_err.CLIENT_ERROR,
|
c.JSON(common_err.CLIENT_ERROR,
|
||||||
model.Result{Success: common_err.PWD_INVALID, Message: common_err.GetMsg(common_err.PWD_INVALID)})
|
model.Result{Success: common_err.USER_NOT_EXIST_OR_PWD_INVALID, Message: common_err.GetMsg(common_err.USER_NOT_EXIST_OR_PWD_INVALID)})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -258,7 +258,7 @@ func PutUserInfo(c *gin.Context) {
|
|||||||
user := service.MyService.User().GetUserInfoById(id)
|
user := service.MyService.User().GetUserInfoById(id)
|
||||||
if user.Id == 0 {
|
if user.Id == 0 {
|
||||||
c.JSON(common_err.SERVICE_ERROR,
|
c.JSON(common_err.SERVICE_ERROR,
|
||||||
model.Result{Success: common_err.USER_NOT_EXIST, Message: common_err.GetMsg(common_err.USER_NOT_EXIST)})
|
model.Result{Success: common_err.USER_NOT_EXIST_OR_PWD_INVALID, Message: common_err.GetMsg(common_err.USER_NOT_EXIST_OR_PWD_INVALID)})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if len(json.Username) > 0 {
|
if len(json.Username) > 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user