luci-app-travelmate: fix QR-Code generation
authorDirk Brenken <dev@brenken.org>
Mon, 8 May 2023 14:25:01 +0000 (16:25 +0200)
committerDirk Brenken <dev@brenken.org>
Mon, 8 May 2023 14:25:01 +0000 (16:25 +0200)
* fixed #6377
   According to https://www.wi-fi.org/download.php?file=/sites/default/files/private/WPA3_Specification_v3.0.pdf (chapter 7)
   set the security type to 'WPA'. Tested with an Android device (Samsung 10e) and various WPA2- and WPA3-AP modes
   (incl. OWE, but without enterprise variants).

Signed-off-by: Dirk Brenken <dev@brenken.org>
applications/luci-app-travelmate/htdocs/luci-static/resources/view/travelmate/overview.js

index 88a0aadf5e14bf467a9ef3e9015a1e719a9eff0e..a8069135a02323cebde9293b99b6997a73d984ca 100644 (file)
@@ -93,12 +93,11 @@ function handleAction(ev) {
                                                w_enc = w_sections[w_sid].encryption;
                                                w_key = w_sections[w_sid].key;
                                                w_hidden = (w_sections[w_sid].hidden == 1 ? 'true' : 'false');
-                                               if (w_enc.startsWith('psk')) {
-                                                       w_enc = 'WPA';
-                                               }
-                                               else if (w_enc === 'none') {
+                                               if (w_enc === 'none') {
                                                        w_enc = 'nopass';
                                                        w_key = 'nokey';
+                                               } else {
+                                                       w_enc = 'WPA';
                                                }
                                                L.resolveDefault(fs.exec_direct('/usr/bin/qrencode', ['--inline', '--8bit', '--type=SVG', '--output=-', 'WIFI:S:' + w_ssid + ';T:' + w_enc + ';P:' + w_key + ';H:' + w_hidden + ';']), null).then(function (res) {
                                                        if (res) {