From 3dc9bad6ae8bff78f81e2f90a6e4fd25a8c86a82 Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Sat, 19 Jan 2013 14:16:59 -0500 Subject: [PATCH] redirect when userObj not present (that should never be happening, but it is - diagnosing) --- src/app/index.coffee | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/app/index.coffee b/src/app/index.coffee index c854e70013..b0b812dcdf 100644 --- a/src/app/index.coffee +++ b/src/app/index.coffee @@ -25,10 +25,9 @@ get '/', (page, model, next) -> #if req.headers['x-forwarded-proto']!='https' and process.env.NODE_ENV=='production' # return page.redirect 'https://' + req.headers.host + req.url - userPath = "users.#{model.session.userId}" - model.subscribe userPath, (err, user) -> - # Set variables which are passed from the controller to the view + model.subscribe "users.#{model.session.userId}", (err, user) -> userObj = user.get() + return page.redirect '/500.html' unless userObj? #this should never happen, but it is. Looking into it # support legacy Everyauth schema (now using derby-auth, Passport) if username = userObj.auth?.local?.username