Chore/minor execution view ui fix (#5069)

* minor execution view ui fix

* add password validation
This commit is contained in:
Henry Heng
2025-08-14 21:59:34 +08:00
committed by GitHub
parent e99aecb473
commit 7a74e33be1
3 changed files with 21 additions and 6 deletions
@@ -18,6 +18,16 @@ export function isInvalidDateTime(dateTime: unknown): boolean {
}
export function isInvalidPassword(password: unknown): boolean {
// Minimum Length: At least 8 characters
// Maximum Length: No more than 128 characters
// Lowercase Letter: Must contain at least one lowercase letter (a-z)
// Uppercase Letter: Must contain at least one uppercase letter (A-Z)
// Digit: Must contain at least one number (0-9)
// Special Character: Must contain at least one special character (anything that's not a letter or number)
if (!password || typeof password !== 'string' || password.length > 128) {
return true
}
const regexPassword = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^a-zA-Z0-9]).{8,}$/
return !password || typeof password !== 'string' || !regexPassword.test(password)
return !regexPassword.test(password)
}