mirror of
https://github.com/usememos/memos.git
synced 2025-10-02 02:24:39 +08:00
fix: patch user with nil password (#1290)
This commit is contained in:
parent
c1903df374
commit
37366dc2e1
1 changed files with 2 additions and 2 deletions
|
@ -113,10 +113,10 @@ func (patch UserPatch) Validate() error {
|
|||
if patch.Username != nil && len(*patch.Username) > 32 {
|
||||
return fmt.Errorf("username is too long, maximum length is 32")
|
||||
}
|
||||
if len(*patch.Password) < 3 {
|
||||
if patch.Password != nil && len(*patch.Password) < 3 {
|
||||
return fmt.Errorf("password is too short, minimum length is 6")
|
||||
}
|
||||
if len(*patch.Password) > 512 {
|
||||
if patch.Password != nil && len(*patch.Password) > 512 {
|
||||
return fmt.Errorf("password is too long, maximum length is 512")
|
||||
}
|
||||
if patch.Nickname != nil && len(*patch.Nickname) > 64 {
|
||||
|
|
Loading…
Add table
Reference in a new issue