mirror of
https://github.com/cloudreve/cloudreve.git
synced 2025-11-02 11:42:22 +08:00
fix(session): increase password length limit to 128
This commit is contained in:
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user