1
0
mirror of https://gitlab.nic.cz/turris/reforis/foris-js.git synced 2024-09-28 11:14:20 +02:00

Fix WiFi password max length check

The WiFi password cannot be longer than 63 symbols.
This commit is contained in:
Gabriel GRONDIN 2022-01-19 14:29:48 +01:00 committed by Aleksandr Gumroian
parent a1e9f23620
commit 048e686185
No known key found for this signature in database
GPG Key ID: 9E77849C64F0A733

View File

@ -82,6 +82,10 @@ export function validator(formData) {
if (device.password.length < 8)
errors.password = _("Password must contain at least 8 symbols");
if (device.password.length >= 64)
errors.password = _(
"Password must not contain more than 63 symbols"
);
if (!device.guest_wifi.enabled) return errors;
@ -97,6 +101,10 @@ export function validator(formData) {
guest_wifi_errors.password = _(
"Password must contain at least 8 symbols"
);
if (device.guest_wifi.password.length >= 64)
guest_wifi_errors.password = _(
"Password must not contain more than 63 symbols"
);
if (guest_wifi_errors.SSID || guest_wifi_errors.password) {
errors.guest_wifi = guest_wifi_errors;