fix case when req.session is undefined and use correct syntax for authWithSession

This commit is contained in:
Matteo Pagliazzi
2016-02-19 12:23:53 +01:00
parent 192c57fa85
commit feadfbcd9e
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -36,7 +36,7 @@ let api = {};
api.exportUserHistory = {
method: 'GET',
url: '/export/history.csv',
middlewares: [authWithSession(), cron],
middlewares: [authWithSession, cron],
async handler (req, res) {
let user = res.locals.user;
@@ -104,7 +104,7 @@ async function _getUserDataForExport (user) {
api.exportUserDataJson = {
method: 'GET',
url: '/export/userdata.json',
middlewares: [authWithSession(), cron],
middlewares: [authWithSession, cron],
async handler (req, res) {
let userData = await _getUserDataForExport(res.locals.user);
@@ -129,7 +129,7 @@ api.exportUserDataJson = {
api.exportUserDataXml = {
method: 'GET',
url: '/export/userdata.xml',
middlewares: [authWithSession(), cron],
middlewares: [authWithSession, cron],
async handler (req, res) {
let userData = await _getUserDataForExport(res.locals.user);