Skip to content
Snippets Groups Projects
Commit 176dba8f authored by Markus Grigull's avatar Markus Grigull
Browse files

Add validateToken to all routes

Remove log file in development mode
parent 78a7b057
No related branches found
No related tags found
No related merge requests found
...@@ -27,7 +27,6 @@ module.exports = { ...@@ -27,7 +27,6 @@ module.exports = {
port: 4000, port: 4000,
secret: 'longsecretislong', secret: 'longsecretislong',
logLevel: 'debug', // possible values: error, warn, info, verbose or debug logLevel: 'debug', // possible values: error, warn, info, verbose or debug
logFile: 'log.txt',
admin: { admin: {
username: 'admin', username: 'admin',
password: 'admin' password: 'admin'
......
...@@ -33,7 +33,7 @@ var User = require('../models/user'); ...@@ -33,7 +33,7 @@ var User = require('../models/user');
var router = express.Router(); var router = express.Router();
// all file routes need authentication // all file routes need authentication
//router.use('/files', auth.validateToken); router.use('/files', auth.validateToken);
// routes // routes
router.get('/files', auth.validateToken, function(req, res) { router.get('/files', auth.validateToken, function(req, res) {
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
// include // include
var express = require('express'); var express = require('express');
var auth = require('../auth');
var logger = require('../utils/logger'); var logger = require('../utils/logger');
// models // models
...@@ -30,6 +31,9 @@ var Node = require('../models/node'); ...@@ -30,6 +31,9 @@ var Node = require('../models/node');
// create router // create router
var router = express.Router(); var router = express.Router();
// all node routes need authentication
router.use('/nodes', auth.validateToken);
// routes // routes
router.get('/nodes', function(req, res) { router.get('/nodes', function(req, res) {
// get all nodes // get all nodes
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
// include // include
var express = require('express'); var express = require('express');
//var auth = require('../auth'); var auth = require('../auth');
var logger = require('../utils/logger'); var logger = require('../utils/logger');
// models // models
...@@ -34,7 +34,7 @@ var Simulation = require('../models/simulation'); ...@@ -34,7 +34,7 @@ var Simulation = require('../models/simulation');
var router = express.Router(); var router = express.Router();
// all project routes need authentication // all project routes need authentication
//router.use('/projects', auth.validateToken); router.use('/projects', auth.validateToken);
// routes // routes
router.get('/projects', /*auth.validateRole('project', 'read'),*/ function(req, res) { router.get('/projects', /*auth.validateRole('project', 'read'),*/ function(req, res) {
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
// include // include
var express = require('express'); var express = require('express');
//var auth = require('../auth'); var auth = require('../auth');
var logger = require('../utils/logger'); var logger = require('../utils/logger');
// models // models
...@@ -33,7 +33,7 @@ var User = require('../models/user'); ...@@ -33,7 +33,7 @@ var User = require('../models/user');
var router = express.Router(); var router = express.Router();
// all model routes need authentication // all model routes need authentication
//router.use('/simulations', auth.validateToken); router.use('/simulations', auth.validateToken);
// routes // routes
router.get('/simulations', /*auth.validateRole('simulation', 'read'),*/ function(req, res) { router.get('/simulations', /*auth.validateRole('simulation', 'read'),*/ function(req, res) {
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
// include // include
var express = require('express'); var express = require('express');
//var auth = require('../auth'); var auth = require('../auth');
var logger = require('../utils/logger'); var logger = require('../utils/logger');
// models // models
...@@ -33,7 +33,7 @@ var Project = require('../models/project'); ...@@ -33,7 +33,7 @@ var Project = require('../models/project');
var router = express.Router(); var router = express.Router();
// all visualization routes need authentication // all visualization routes need authentication
//router.use('/visualizations', auth.validateToken); router.use('/visualizations', auth.validateToken);
// routes // routes
router.get('/visualizations', /*auth.validateRole('visualization', 'read'),*/ function(req, res) { router.get('/visualizations', /*auth.validateRole('visualization', 'read'),*/ function(req, res) {
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
// include // include
var express = require('express'); var express = require('express');
//var auth = require('../auth'); var auth = require('../auth');
var logger = require('../utils/logger'); var logger = require('../utils/logger');
// models // models
...@@ -33,7 +33,7 @@ var Visualization = require('../models/visualization'); ...@@ -33,7 +33,7 @@ var Visualization = require('../models/visualization');
var router = express.Router(); var router = express.Router();
// all widget routes need authentication // all widget routes need authentication
//router.use('/widgets', auth.validateToken); router.use('/widgets', auth.validateToken);
// routes // routes
router.get('/widgets', /*auth.validateRole('visualization', 'read'),*/ function(req, res) { router.get('/widgets', /*auth.validateRole('visualization', 'read'),*/ function(req, res) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment