mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-01 11:40:25 +00:00
redirect when userObj not present (that should never be happening, but
it is - diagnosing)
This commit is contained in:
parent
a3e75da2ba
commit
3dc9bad6ae
1 changed files with 2 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue