Skip to content

Instantly share code, notes, and snippets.

@azizulhakim
Last active October 29, 2016 04:18
Show Gist options
  • Save azizulhakim/2900e079e451e27f9881c868cc2171d0 to your computer and use it in GitHub Desktop.
Save azizulhakim/2900e079e451e27f9881c868cc2171d0 to your computer and use it in GitHub Desktop.
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