update/fix-password-strength-check

This commit is contained in:
SowinskiBraeden committed 2022-01-13 09:27:41 -08:00
1 parent 9fd568ddc3
commit 9681ded4d0
3 files changed
+17 -17

No files matched your search

+6 -6
View File
@@ -59,17 +59,17 @@ func (s *Student) ComparePasswords(password string) bool {
func (s *Student) CheckPasswordStrength(password string) bool {
var hasUpper bool = true
var hasUpper bool = false
for _, r := range password {
if !unicode.IsUpper(r) && unicode.IsLetter(r) {
hasUpper = false
if unicode.IsUpper(r) && unicode.IsLetter(r) {
hasUpper = true
}
}
var hasLower bool = true
var hasLower bool = false
for _, r := range password {
if !unicode.IsLower(r) && unicode.IsLetter(r) {
hasLower = false
if unicode.IsLower(r) && unicode.IsLetter(r) {
hasLower = true
}
}