mirror of
https://github.com/glenndehaan/unifi-voucher-site.git
synced 2026-03-31 06:24:00 -04:00
Fixed OIDC loop when using local authentication. Removed default auth setting for mail.js. Updated dependencies
This commit is contained in:
@@ -52,13 +52,16 @@ module.exports = {
|
||||
if(variables.authOidcEnabled) {
|
||||
oidc = req.oidc.isAuthenticated();
|
||||
|
||||
// Retrieve user info/verify user session is still valid
|
||||
req.user = await req.oidc.fetchUserInfo().catch(() => {
|
||||
res.redirect(302, `${req.headers['x-ingress-path'] ? req.headers['x-ingress-path'] : ''}/login`);
|
||||
});
|
||||
// Check if OIDC is used to authenticate
|
||||
if(oidc) {
|
||||
// Retrieve user info/verify user session is still valid
|
||||
req.user = await req.oidc.fetchUserInfo().catch(() => {
|
||||
res.redirect(302, `${req.headers['x-ingress-path'] ? req.headers['x-ingress-path'] : ''}/login`);
|
||||
});
|
||||
|
||||
if(!req.user) {
|
||||
return;
|
||||
if (!req.user) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,20 +20,31 @@ const time = require('../utils/time');
|
||||
const bytes = require('../utils/bytes');
|
||||
|
||||
/**
|
||||
* Create nodemailer transport
|
||||
* Base SMTP config
|
||||
*/
|
||||
const transport = nodemailer.createTransport({
|
||||
const smtpConfig = {
|
||||
host: variables.smtpHost,
|
||||
port: parseInt(variables.smtpPort),
|
||||
secure: variables.smtpSecure,
|
||||
tls: {
|
||||
rejectUnauthorized: false // Skip TLS Certificate checks for Self-Hosted systems
|
||||
},
|
||||
auth: {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Include SMTP auth if defined
|
||||
*/
|
||||
if(variables.smtpUsername !== '' && variables.smtpPassword !== '') {
|
||||
smtpConfig.auth = {
|
||||
user: variables.smtpUsername,
|
||||
pass: variables.smtpPassword
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Create nodemailer transport
|
||||
*/
|
||||
const transport = nodemailer.createTransport(smtpConfig);
|
||||
|
||||
/**
|
||||
* Mail module functions
|
||||
|
||||
10
package.json
10
package.json
@@ -17,21 +17,21 @@
|
||||
"dependencies": {
|
||||
"cookie-parser": "^1.4.7",
|
||||
"ejs": "^3.1.10",
|
||||
"express": "^5.1.0",
|
||||
"express": "^5.2.0",
|
||||
"express-locale": "^2.0.2",
|
||||
"express-openid-connect": "^2.19.2",
|
||||
"express-openid-connect": "^2.19.3",
|
||||
"js-logger": "^1.6.1",
|
||||
"jsonwebtoken": "^9.0.2",
|
||||
"multer": "^2.0.2",
|
||||
"node-thermal-printer": "^4.5.0",
|
||||
"nodemailer": "^7.0.10",
|
||||
"nodemailer": "^7.0.11",
|
||||
"pdfkit": "^0.17.2",
|
||||
"qrcode": "^1.5.4",
|
||||
"undici": "^7.16.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/cli": "^4.1.16",
|
||||
"@tailwindcss/cli": "^4.1.17",
|
||||
"@tailwindcss/forms": "^0.5.10",
|
||||
"tailwindcss": "^4.1.16"
|
||||
"tailwindcss": "^4.1.17"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user