fix(session): increase password length limit to 128

This commit is contained in:
Aaron Liu
2025-05-13 15:05:01 +08:00
parent 10e3854082
commit 006bcabcdb
4 changed files with 9 additions and 5 deletions

View File

@ -165,6 +165,10 @@ func (s *UpsertUserService) Update(c *gin.Context) (*GetUserResponse, error) {
}
if s.Password != "" && len(s.Password) > 128 {
return nil, serializer.NewError(serializer.CodeParamErr, "Password too long", nil)
}
newUser, err := userClient.Upsert(ctx, s.User, s.Password, s.TwoFA)
if err != nil {
return nil, serializer.NewError(serializer.CodeDBError, "Failed to update user", err)