feat: password auth
This commit is contained in:
parent
6c704828ce
commit
7443547593
7 changed files with 317 additions and 9 deletions
15
internal/validation/password.go
Normal file
15
internal/validation/password.go
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
package validation
|
||||
|
||||
import "errors"
|
||||
|
||||
func ValidatePassword(password string) error {
|
||||
if password == "" {
|
||||
return errors.New("password is required")
|
||||
}
|
||||
|
||||
if len(password) < 12 {
|
||||
return errors.New("password must be at least 12 characters")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue