Add password reset functionality to user dashboard page

This commit is contained in:
2024-07-08 23:08:45 +07:00
parent f01407990f
commit 97a9e72d7b
9 changed files with 151 additions and 108 deletions

View File

@ -72,19 +72,10 @@ func ValidatePassword(password string) bool {
}
var (
hasSymbol bool
hasNumber int
hasUppercase bool
)
symbols := []string{"!", "@", "#", "$", "%", "^", "&", "*"}
for _, symbol := range symbols {
if strings.Contains(password, symbol) {
hasSymbol = true
}
}
for _, char := range password {
switch {
case unicode.IsNumber(char):
@ -94,7 +85,7 @@ func ValidatePassword(password string) bool {
}
}
return hasSymbol && hasNumber >= 3 && hasUppercase
return hasNumber >= 3 && hasUppercase
}
func ConvertFileSize(byte int64) string {