Fix: create room no need pwd

pull/21/head
zijiren233 3 years ago
parent de1ce940b4
commit 584ed7510d

@ -49,10 +49,12 @@ func (c *CreateRoomReq) Validate() error {
return ErrRoomIdHasInvalidChar
}
if len(c.Password) > 32 {
return ErrPasswordTooLong
} else if !alphaNumReg.MatchString(c.Password) {
return ErrPasswordHasInvalidChar
if c.Password != "" {
if len(c.Password) > 32 {
return ErrPasswordTooLong
} else if !alphaNumReg.MatchString(c.Password) {
return ErrPasswordHasInvalidChar
}
}
if c.Username == "" {

Loading…
Cancel
Save