From bd843ced6915974d5850f08cd9d8c0fe3be97ddd Mon Sep 17 00:00:00 2001 From: Lloyd Hilaiel <lloyd@hilaiel.com> Date: Fri, 15 Apr 2011 14:51:24 -0600 Subject: [PATCH] boogs --- authority/server/wsapi.js | 2 +- authority/static/dialog/main.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/authority/server/wsapi.js b/authority/server/wsapi.js index dbe09145c..2c92b61c2 100644 --- a/authority/server/wsapi.js +++ b/authority/server/wsapi.js @@ -158,7 +158,7 @@ exports.set_key = function (req, resp) { exports.am_authed = function(req,resp) { logRequest("am_authed", req.session); - httputils.jsonResponse(resp, (typeof req.session.authenticatedUser === 'string')); + httputils.jsonResponse(resp, isAuthed(req)); }; exports.sync_emails = function(req,resp) { diff --git a/authority/static/dialog/main.js b/authority/static/dialog/main.js index 0d6058fbf..cce7089fb 100644 --- a/authority/static/dialog/main.js +++ b/authority/static/dialog/main.js @@ -51,7 +51,11 @@ // sent list, and also may include identities registered on other devices. // we'll go through the list and generate new keypairs var identities = { }; - var emails = JSON.parse(window.localStorage.emails); + var emails = {}; + if (window.localStorage.emails) { + emails = JSON.parse(window.localStorage.emails); + } + for (var e in emails) { if (!emails.hasOwnProperty(e)) continue; identities[e] = emails[e].pub; -- GitLab