Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
cleaning up jslint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lirantal committed Jan 21, 2014
1 parent 55aeaad commit 8324179
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
8 changes: 4 additions & 4 deletions app/routes/articles.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -23,4 +23,4 @@ module.exports = function(app, passport) {
// Finish with setting up the articleId param
app.param('articleId', articles.article);

};
};
2 changes: 1 addition & 1 deletion app/routes/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

module.exports = function(app, passport) {
module.exports = function(app) {

// Home route
var index = require('../controllers/index');
Expand Down
8 changes: 0 additions & 8 deletions app/routes/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8324179

Please sign in to comment.