(password, confirmedPassword string)
| 89 | } |
| 90 | |
| 91 | func isPasswordValid(password, confirmedPassword string) (string, bool) { |
| 92 | if password == "" && confirmedPassword == "" { |
| 93 | return "", true |
| 94 | } |
| 95 | |
| 96 | if password != confirmedPassword { |
| 97 | return "Password confirmation doesn't match", false |
| 98 | } |
| 99 | if len(password) < 24 || len(password) > 64 { |
| 100 | return "Password must contain between 24 and 64 characters", false |
| 101 | } |
| 102 | return "", true |
| 103 | } |
| 104 | |
| 105 | func isUsernameValid(username string) (string, bool) { |
| 106 | if len(username) < 6 || len(username) > 32 { |
no outgoing calls