This commit is contained in:
Jan Prochazka 2022-11-28 21:21:24 +01:00
parent 6ddb8b8bf9
commit 3dc63507ad

View File

@ -28,7 +28,12 @@ module.exports = {
get_meta: true,
async get(_params, req) {
const logins = getLogins();
const login = req.user ? req.user.login : logins ? logins.find(x => x.login == (req.auth && req.auth.user)) : null;
const login =
req && req.user
? req.user.login
: logins
? logins.find(x => x.login == (req && req.auth && req.auth.user))
: null;
const permissions = login ? login.permissions : process.env.PERMISSIONS;
return {