mirror of
https://github.com/glenndehaan/unifi-voucher-site.git
synced 2026-03-31 06:24:02 -04:00
38 lines
911 B
JavaScript
38 lines
911 B
JavaScript
/**
|
|
* Import base packages
|
|
*/
|
|
const crypto = require('crypto');
|
|
|
|
/**
|
|
* Import own modules
|
|
*/
|
|
const variables = require('../modules/variables');
|
|
|
|
/**
|
|
* Import own utils
|
|
*/
|
|
const status = require('../utils/status');
|
|
|
|
module.exports = {
|
|
/**
|
|
* GET - /status
|
|
*
|
|
* @param req
|
|
* @param res
|
|
*/
|
|
get: async (req, res) => {
|
|
const user = req.oidc ? await req.oidc.fetchUserInfo() : { email: 'admin' };
|
|
|
|
res.render('status', {
|
|
baseUrl: req.headers['x-ingress-path'] ? req.headers['x-ingress-path'] : '',
|
|
gitTag: variables.gitTag,
|
|
gitBuild: variables.gitBuild,
|
|
kioskEnabled: variables.kioskEnabled,
|
|
user: user,
|
|
userIcon: req.oidc ? crypto.createHash('sha256').update(user.email).digest('hex') : '',
|
|
authDisabled: variables.authDisabled,
|
|
status: status()
|
|
});
|
|
}
|
|
};
|