Skip to content

Commit e186c65

Browse files
committed
Update validation checks to not use regex
1 parent acf12c1 commit e186c65

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/auth/src/core/auth/auth_impl.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,11 +481,11 @@ export class AuthImpl implements AuthInternal, _FirebaseService {
481481
let nonAlphaNumericFlag = false;
482482
for (let i = 0; i < password.length; i++) {
483483
char = password.charAt(i);
484-
if (/^\d$/.test(char)) {
484+
if (char >= '0' && char <= '9') {
485485
numberFlag = true;
486-
} else if (/^[A-Z]$/.test(char)) {
486+
} else if (char >= 'A' && char <= 'Z') {
487487
upperCaseFlag = true;
488-
} else if (/^[a-z]$/.test(char)) {
488+
} else if (char >= 'a' && char <= 'z') {
489489
lowerCaseFlag = true;
490490
} else if (policy.allowedNonAlphanumericCharacters.includes(char)) {
491491
nonAlphaNumericFlag = true;

0 commit comments

Comments
 (0)