potentially fix the too many redirects issue

This commit is contained in:
Quincy Larson
2015-05-01 21:32:24 -07:00
parent 18d9f06c14
commit ec5c542d07
3 changed files with 13 additions and 15 deletions

View File

@@ -3,7 +3,13 @@
* Home page.
*/
exports.index = function(req, res) {
exports.index = function(req, res, next) {
if (req.user && !req.user.profile.picture) {
req.user.profile.picture = 'https://s3.amazonaws.com/freecodecamp/camper-image-placeholder.png';
req.user.save(function(err) {
if (err) { return next(err); }
});
}
res.render('home', {
title: 'Learn to Code JavaScript and get a Coding Job by Helping Nonprofits'
});