From c75063d7ca5800948e9c09c0a6efe9809b5d39f7 Mon Sep 17 00:00:00 2001 From: CorrectRoadH Date: Mon, 5 Feb 2024 14:13:58 +0800 Subject: [PATCH] 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 --- route/v1/user.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/route/v1/user.go b/route/v1/user.go index 87e0077..90a7c01 100644 --- a/route/v1/user.go +++ b/route/v1/user.go @@ -116,7 +116,7 @@ func PostUserLogin(c *gin.Context) { } if user.Password != encryption.GetMD5ByStr(password) { 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 } @@ -258,7 +258,7 @@ func PutUserInfo(c *gin.Context) { user := service.MyService.User().GetUserInfoById(id) if user.Id == 0 { 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 } if len(json.Username) > 0 {