Check if user input empty username

This commit is contained in:
2025-01-30 19:37:40 +09:00
parent b4d525926a
commit 8c46cfebe5
3 changed files with 15 additions and 1 deletions
+8
View File
@@ -14,4 +14,12 @@ validate_email() {
return 1
fi
return 0
}
validate_username() {
if [[ -z "$1" ]] || [[ "$1" =~ ^[[:space:]]*$ ]]; then
echo -e "${RED}Username cannot be empty${NC}"
return 1
fi
return 0
}