Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added WPA2/WPA3 and WPA3 only. #1479

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/tools/wifi-qr-code-generator/useQRCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
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
Expand Down Expand Up @@ -70,7 +70,13 @@
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) {

Check failure on line 73 in src/tools/wifi-qr-code-generator/useQRCode.ts

View workflow job for this annotation

GitHub Actions / ci

Expected indentation of 2 spaces but found 0
return `WIFI:S:${escapeString(ssid)};T:WPA3;P:${escapeString(password)};${isHiddenSSID ? 'H:true;' : ''}R:1;;`;
}

Check failure on line 75 in src/tools/wifi-qr-code-generator/useQRCode.ts

View workflow job for this annotation

GitHub Actions / ci

Expected indentation of 2 spaces but found 0
if (encryption === 'WPA2/WPA3' && password) {

Check failure on line 76 in src/tools/wifi-qr-code-generator/useQRCode.ts

View workflow job for this annotation

GitHub Actions / ci

Expected indentation of 2 spaces but found 0
return `WIFI:S:${escapeString(ssid)};T:WPA3;P:${escapeString(password)};${isHiddenSSID ? 'H:true;' : ''};`;
}

Check failure on line 78 in src/tools/wifi-qr-code-generator/useQRCode.ts

View workflow job for this annotation

GitHub Actions / ci

Expected indentation of 2 spaces but found 0
if (encryption !== 'WPA2-EAP' && password) {

Check failure on line 79 in src/tools/wifi-qr-code-generator/useQRCode.ts

View workflow job for this annotation

GitHub Actions / ci

Expected indentation of 2 spaces but found 0
// 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' : ''};`;
Expand Down
8 changes: 8 additions & 0 deletions src/tools/wifi-qr-code-generator/wifi-qr-code-generator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Loading