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

Commit

Permalink
Fixing article and express 4 modification
Browse files Browse the repository at this point in the history
  • Loading branch information
amoshaviv committed Apr 26, 2014
1 parent 36acc48 commit 5ff49a7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion app/routes/core.server.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
module.exports = function(app) {
// Root routing
var core = require('../../app/controllers/core.server.controller');
app.get('/', core.index);
app.route('/').get(core.index);
};
30 changes: 15 additions & 15 deletions app/routes/users.server.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,38 @@ var passport = require('passport');
module.exports = function(app) {
// User Routes
var users = require('../../app/controllers/users.server.controller');
app.get('/users/me', users.me);
app.put('/users', users.update);
app.post('/users/password', users.changePassword);
app.del('/users/accounts', users.removeOAuthProvider);
app.route('/users/me').get(users.me);
app.route('/users').put(users.update);
app.route('/users/password').post(users.changePassword);
app.route('/users/accounts').delete(users.removeOAuthProvider);

// Setting up the users api
app.post('/auth/signup', users.signup);
app.post('/auth/signin', users.signin);
app.get('/auth/signout', users.signout);
app.route('/auth/signup').post(users.signup);
app.route('/auth/signin').post(users.signin);
app.route('/auth/signout').get(users.signout);

// Setting the facebook oauth routes
app.get('/auth/facebook', passport.authenticate('facebook', {
app.route('/auth/facebook').get(passport.authenticate('facebook', {
scope: ['email']
}));
app.get('/auth/facebook/callback', users.oauthCallback('facebook'));
app.route('/auth/facebook/callback').get(users.oauthCallback('facebook'));

// Setting the twitter oauth routes
app.get('/auth/twitter', passport.authenticate('twitter'));
app.get('/auth/twitter/callback', users.oauthCallback('twitter'));
app.route('/auth/twitter').get(passport.authenticate('twitter'));
app.route('/auth/twitter/callback').get(users.oauthCallback('twitter'));

// Setting the google oauth routes
app.get('/auth/google', passport.authenticate('google', {
app.route('/auth/google').get(passport.authenticate('google', {
scope: [
'https://www.googleapis.com/auth/userinfo.profile',
'https://www.googleapis.com/auth/userinfo.email'
]
}));
app.get('/auth/google/callback', users.oauthCallback('google'));
app.route('/auth/google/callback').get(users.oauthCallback('google'));

// Setting the linkedin oauth routes
app.get('/auth/linkedin', passport.authenticate('linkedin'));
app.get('/auth/linkedin/callback', users.oauthCallback('linkedin'));
app.route('/auth/linkedin').get(passport.authenticate('linkedin'));
app.route('/auth/linkedin/callback').get(users.oauthCallback('linkedin'));

// Finish by binding the user middleware
app.param('userId', users.userByID);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"postinstall": "bower install --config.interactive=false"
},
"dependencies": {
"express": "~4.0.0",
"express": "~4.1.0",
"express-session": "~1.0.2",
"body-parser": "~1.0.1",
"cookie-parser": "~1.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h1>{{article.title}}</h1>
</div>

<div class="pull-right" data-ng-show="authentication.user._id == article.user._id || true">
<div class="pull-right" data-ng-show="authentication.user._id == article.user._id">
<a class="btn btn-primary" href="/#!/articles/{{article._id}}/edit">
<i class="glyphicon glyphicon-edit"></i>
</a>
Expand Down

0 comments on commit 5ff49a7

Please sign in to comment.