luci-mod-network: resolve authentication issues during 802.1X Wi-Fi connection
authortuvokyang <[email protected]>
Sat, 20 Sep 2025 07:05:23 +0000 (15:05 +0800)
committerPaul Donald <[email protected]>
Sat, 11 Oct 2025 18:02:30 +0000 (20:02 +0200)
Signed-off-by: tuvokyang <[email protected]>
modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js

index 1cf5ad37a3544387bfb6d6da36b6afe99c94369e..708a4f510b94c3e945b77d4ffc669427a44a0c62 100644 (file)
@@ -2100,8 +2100,8 @@ return view.extend({
                        const zoneval = zoneopt ? zoneopt.formvalue('_new_') : null;
                        const enc = L.isObject(bss.encryption) ? bss.encryption : null;
                        const is_wep = (enc && Array.isArray(enc.wep));
-                       const is_psk = (enc && Array.isArray(enc.wpa) && L.toArray(enc.authentication).filter(function(a) { return a == 'psk'; }).length > 0);
-                       const is_sae = (enc && Array.isArray(enc.wpa) && L.toArray(enc.authentication).filter(function(a) { return a == 'sae'; }).length > 0);
+                       const is_psk = (enc && Array.isArray(enc.wpa) && L.toArray(enc.authentication).some(a => a == 'psk'));
+                       const is_sae = (enc && Array.isArray(enc.wpa) && L.toArray(enc.authentication).some(a => a == 'sae'));
 
                        if (nameval == null || (passopt && passval == null))
                                return;
@@ -2218,7 +2218,7 @@ return view.extend({
                        const s2 = m2.section(form.NamedSection, '_new_');
                        const enc = L.isObject(bss.encryption) ? bss.encryption : null;
                        const is_wep = (enc && Array.isArray(enc.wep));
-                       const is_psk = (enc && Array.isArray(enc.wpa) && L.toArray(enc.authentication).filter(function(a) { return a == 'psk' || a == 'sae'; }));
+                       const is_psk = (enc && Array.isArray(enc.wpa) && L.toArray(enc.authentication).some(a => a == 'psk'  || a == 'sae'));
                        let replace, passphrase, name, bssid, zone;
 
                        function nameUsed(name) {