mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-07-07 01:08:01 +02:00
cleaning up jslint warnings
This commit is contained in:
@@ -6,13 +6,13 @@ var authorization = require('./middlewares/authorization');
|
||||
|
||||
// Article authorization helpers
|
||||
var hasAuthorization = function(req, res, next) {
|
||||
if (req.article.user.id != req.user.id) {
|
||||
if (req.article.user.id !== req.user.id) {
|
||||
return res.send(401, 'User is not authorized');
|
||||
}
|
||||
next();
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = function(app, passport) {
|
||||
module.exports = function(app) {
|
||||
|
||||
app.get('/articles', articles.all);
|
||||
app.post('/articles', authorization.requiresLogin, articles.create);
|
||||
@@ -23,4 +23,4 @@ module.exports = function(app, passport) {
|
||||
// Finish with setting up the articleId param
|
||||
app.param('articleId', articles.article);
|
||||
|
||||
};
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function(app, passport) {
|
||||
module.exports = function(app) {
|
||||
|
||||
// Home route
|
||||
var index = require('../controllers/index');
|
||||
|
||||
@@ -3,14 +3,6 @@
|
||||
// User routes use users controller
|
||||
var users = require('../controllers/users');
|
||||
|
||||
// User authorization helpers
|
||||
var hasAuthorization = function(req, res, next) {
|
||||
if (req.profile.id != req.user.id) {
|
||||
return res.send(401, 'User is not authorized');
|
||||
}
|
||||
next();
|
||||
}
|
||||
|
||||
module.exports = function(app, passport) {
|
||||
|
||||
app.get('/signin', users.signin);
|
||||
|
||||
Reference in New Issue
Block a user