fix change password and support 3 decimal places

This commit is contained in:
Akhil Gupta
2021-06-01 21:43:41 +05:30
parent d41a41e25a
commit 1ca98cec24
7 changed files with 14 additions and 10 deletions

View File

@@ -169,7 +169,7 @@ func changePassword(c *gin.Context) {
}
if user.CheckPassword(request.OldPassword) != nil {
c.JSON(http.StatusForbidden, common.NewError("changePassword", errors.New("Not Registered email or invalid password")))
c.JSON(http.StatusForbidden, common.NewError("changePassword", errors.New("Incorrect old password")))
return
}

View File

@@ -25,6 +25,6 @@ type RegisterRequest struct {
}
type ChangePasswordRequest struct {
OldPassword string `form:"oldPassword" json:"oldPassword" binding:"required,min=8,max=255"`
OldPassword string `form:"oldPassword" json:"oldPassword" binding:"required,max=255"`
NewPassword string `form:"newPassword" json:"newPassword" binding:"required,min=8,max=255"`
}