summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLi Zhineng <[email protected]>2025-07-15 20:53:42 +0800
committerLi Zhineng <[email protected]>2025-07-15 20:53:42 +0800
commitae5a816156ed554cb94a251088ce1b5005d5112e (patch)
tree03773f9fd706f2477fea3f0e6c735a068d3efae8
parent399a1cbf1674a729106fb4b24d7cac5cd363c077 (diff)
downloadsetup-ae5a816156ed554cb94a251088ce1b5005d5112e.tar.gz
setup-ae5a816156ed554cb94a251088ce1b5005d5112e.zip
add doc
-rw-r--r--main.mjs8
1 files changed, 8 insertions, 0 deletions
diff --git a/main.mjs b/main.mjs
index 00e6d8a..d624101 100644
--- a/main.mjs
+++ b/main.mjs
@@ -509,11 +509,18 @@ class WifiCredentialsForm extends ProgressibleForm {
}
}
+ /**
+ * Validate with the IEEE 802.11 standard.
+ *
+ * @param {string} ssid - The Wi-Fi name
+ * @param {string} password - The Password (WPA/WPA2-PSK)
+ */
validate(ssid, password) {
if (ssid === '' ) {
throw new Error('SSID cannot be empty.')
}
+ // The SSID is up to 32 characters
if (ssid.length > 32) {
throw new Error('SSID cannot be longer than 32 characters.')
}
@@ -522,6 +529,7 @@ class WifiCredentialsForm extends ProgressibleForm {
throw new Error('Password cannot be empty.')
}
+ // The password is between 8 and 63 characters
if (password.length < 8 || password.length > 63) {
throw new Error('Password must be between 8 and 63 characters long.')
}