Skip to content

Node.js based forum software built for the modern web

Merge branch 'master' of https://github.com/psychobunny/NodeBB

psychobunny6dfc44c63ccd
diff --cc src/webserver.js
index fab58903d6,5dac314341..d74ebc9467
--- a/src/webserver.js
+++ b/src/webserver.js
@@@ -362,12 -359,16 +359,14 @@@ passport.deserializeUser(function(uid,
}
user.getUserData(req.params.uid, function(data) {
-
- if(req.url.indexOf(data.username) == -1)
- res.redirect(301, '/users/'+req.params.uid+'/'+data.username);
+ if(data) {
+ if(req.url.indexOf(data.username) == -1)
+ res.redirect(301, '/users/'+req.params.uid+'/'+data.username);
+ else
- res.send(templates['header'] + '<pre>'+JSON.stringify(data, null, 4)+'</pre>' + templates['footer']);
- //res.send(templates['header'] + '<script>templates.ready(function(){ajaxify.go("' + 'account' + '");});</script>' + templates['footer']);
++ res.send(templates['header'] + '<script>templates.ready(function(){ajaxify.go("users/' + req.params.uid +'/'+data.username + '");});</script>' + templates['footer']);
+ }
else
- res.send(templates['header'] + '<script>templates.ready(function(){ajaxify.go("users/' + req.params.uid +'/'+data.username + '");});</script>' + templates['footer']);
- res.send("User doesn't exist!");
--
++ res.send("User doesn't exist!");
});
}