Last active
October 29, 2016 04:18
-
-
Save azizulhakim/2900e079e451e27f9881c868cc2171d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.get('/dashboard', isLoggedIn, function(req, res){ | |
req.user.role = req.session.role; | |
var client = {}; | |
if (req.user.facebook){ | |
client = { | |
user : { | |
name : req.user.facebook.name, | |
profilePic : req.user.facebook.profilePic, | |
role : req.user.role | |
} | |
}; | |
} | |
else{ | |
client = { | |
user : { | |
name : req.user.twitter.name, | |
profilePic : req.user.twitter.profilePic, | |
role : req.user.role | |
} | |
}; | |
} | |
res.render('dashboard.ejs', client); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment