From dca2707ae3ae39aa82f07c04ad52e0f212bf8db9 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 7 Apr 2020 09:45:21 -0400 Subject: [PATCH] guard against incorrect types in /auth/ --- www/auth/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/auth/main.js b/www/auth/main.js index c155204ec..fcbeaf3af 100644 --- a/www/auth/main.js +++ b/www/auth/main.js @@ -71,7 +71,7 @@ define([ // Get contacts and extract their avatar channel and key var getData = function (obj, href) { var parsed = Hash.parsePadUrl(href); - if (!parsed || parsed.type !== "file") { return; } // XXX + if (!parsed || parsed.type !== "file") { return; } var secret = Hash.getSecrets('file', parsed.hash); if (!secret.keys || !secret.channel) { return; } obj.avatarKey = Hash.encodeBase64(secret.keys && secret.keys.cryptKey); @@ -81,7 +81,7 @@ define([ contacts.friends = proxy.friends || {}; Object.keys(contacts.friends).map(function (key) { var friend = contacts.friends[key]; - // if (!friend) { return; } // XXX how should this be handled? + if (!friend) { return; } var ret = { edPublic: friend.edPublic, name: friend.displayName, @@ -91,7 +91,7 @@ define([ }); Object.keys(contacts.teams).map(function (key) { var team = contacts.teams[key]; - // if (!team) { return; } // XXX how should this be handled. Is this possible? + if (!team) { return; } var avatar = team.metadata && team.metadata.avatar; var ret = { edPublic: team.keys && team.keys.drive && team.keys.drive.edPublic,