Implemented UNIFI_SSID_PASSWORD environment variable. Updated email template. Updated PDF template. Updated ESC/POS template. Updated README.md. Changed qr.js output based on open or password protected networks

This commit is contained in:
Glenn de Haan
2024-09-21 20:46:05 +02:00
parent da15cf9e34
commit d475c1cc28
8 changed files with 53 additions and 10 deletions

View File

@@ -18,7 +18,7 @@ const variables = require('./variables');
module.exports = (buffer = false) => {
return new Promise((resolve) => {
if(!buffer) {
QRCode.toDataURL(`WIFI:S:${variables.unifiSsid};T:;P:;;`, { version: 4, errorCorrectionLevel: 'Q' }, (err, url) => {
QRCode.toDataURL(`WIFI:S:${variables.unifiSsid};T:${variables.unifiSsidPassword !== '' ? 'WPA' : ''};P:${variables.unifiSsidPassword !== '' ? variables.unifiSsidPassword : ''};;`, { version: 4, errorCorrectionLevel: 'Q' }, (err, url) => {
if(err) {
log.error(`[Qr] Error while generating code!`);
log.error(err);
@@ -27,7 +27,7 @@ module.exports = (buffer = false) => {
resolve(url);
});
} else {
QRCode.toBuffer(`WIFI:S:${variables.unifiSsid};T:;P:;;`, { version: 4, errorCorrectionLevel: 'Q' }, (err, buffer) => {
QRCode.toBuffer(`WIFI:S:${variables.unifiSsid};T:${variables.unifiSsidPassword !== '' ? 'WPA' : ''};P:${variables.unifiSsidPassword !== '' ? variables.unifiSsidPassword : ''};;`, { version: 4, errorCorrectionLevel: 'Q' }, (err, buffer) => {
if(err) {
log.error(`[Qr] Error while generating code!`);
log.error(err);