diff --git a/src/tools/wifi-qr-code-generator/useQRCode.ts b/src/tools/wifi-qr-code-generator/useQRCode.ts index c8a7215c4..0b60e70cd 100644 --- a/src/tools/wifi-qr-code-generator/useQRCode.ts +++ b/src/tools/wifi-qr-code-generator/useQRCode.ts @@ -2,7 +2,7 @@ import { type MaybeRef, get } from '@vueuse/core'; import QRCode, { type QRCodeToDataURLOptions } from 'qrcode'; import { isRef, ref, watch } from 'vue'; -export const wifiEncryptions = ['WEP', 'WPA', 'nopass', 'WPA2-EAP'] as const; +export const wifiEncryptions = ['WEP', 'WPA', 'WPA3', 'WPA2/WPA3', 'nopass', 'WPA2-EAP'] as const; export type WifiEncryption = typeof wifiEncryptions[number]; // @see https://en.wikipedia.org/wiki/Extensible_Authentication_Protocol @@ -70,7 +70,13 @@ function getQrCodeText(options: GetQrCodeTextOptions): string | null { if (encryption === 'nopass') { return `WIFI:S:${escapeString(ssid)};;`; // type can be omitted in that case, and password is not needed, makes the QR Code smaller } - if (encryption !== 'WPA2-EAP' && password) { +if (encryption === 'WPA3' && password) { + return `WIFI:S:${escapeString(ssid)};T:WPA3;P:${escapeString(password)};${isHiddenSSID ? 'H:true;' : ''}R:1;;`; +} +if (encryption === 'WPA2/WPA3' && password) { + return `WIFI:S:${escapeString(ssid)};T:WPA3;P:${escapeString(password)};${isHiddenSSID ? 'H:true;' : ''};`; +} +if (encryption !== 'WPA2-EAP' && password) { // EAP has a lot of options, so we'll handle it separately // WPA and WEP are pretty simple though. return `WIFI:S:${escapeString(ssid)};T:${encryption};P:${escapeString(password)};${isHiddenSSID ? 'H:true' : ''};`; diff --git a/src/tools/wifi-qr-code-generator/wifi-qr-code-generator.vue b/src/tools/wifi-qr-code-generator/wifi-qr-code-generator.vue index e6320d3e7..6e5ef6086 100644 --- a/src/tools/wifi-qr-code-generator/wifi-qr-code-generator.vue +++ b/src/tools/wifi-qr-code-generator/wifi-qr-code-generator.vue @@ -56,6 +56,14 @@ const { download } = useDownloadFileFromBase64({ source: qrcode, filename: 'qr-c label: 'WPA/WPA2', value: 'WPA', }, + { + label: 'WPA3-only (No WPA2 fallback)', + value: 'WPA3', + }, + { + label: 'WPA2/WPA3 (Mixed Mode)', + value: 'WPA2/WPA3', + }, { label: 'WEP', value: 'WEP',