Skip to content
Browse files

Merge branch 'develop' of github.com:nko2/sf2-boys into develop

  • Loading branch information...
2 parents aaab9be + 16e491a commit 948ef8a963d97013d2d3017438cdaeeefa84e159 @jmikola jmikola committed Aug 28, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 server.js
View
6 server.js
@@ -148,7 +148,7 @@ app.post('/events/new.json', andRequireUser, function(req, res){
, imageUrl: req.body.imageUrl
, location: req.body.location
, description: req.body.description
- , author: req.session.auth.twitter.user.name
+ , author: req.session.auth.twitter.user.screen_name
});
event.save(function(err, model){
@@ -171,7 +171,7 @@ app.put('/events/:id.json', andRequireUser, function(req, res){
schema.Event.findOne({_id: req.params.id}, function(err, event) {
if (err) {
res.send('Can not find event', 404);
- } else if (event.get('author') !== req.session.auth.twitter.user.name) {
+ } else if (event.get('author') !== req.session.auth.twitter.user.screen_name) {
res.send('You have no rights', 403);
} else {
event.set('name' , req.body.name);
@@ -243,7 +243,7 @@ app.get('/events.json', function(req, res){
});
app.get('/events/my.json', andRequireUser, function(req, res) {
- schema.Event.find({author: req.session.auth.twitter.user.name}, function(err, events) {
+ schema.Event.find({author: req.session.auth.twitter.user.screen_name}, function(err, events) {
if (err) {
console.log(err);
res.json({error: true}, 500);

0 comments on commit 948ef8a

Please sign in to comment.
Something went wrong with that request. Please try again.