From 68b7609ab6dacf60765a368ffb2b7486c71379fb Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 29 May 2013 14:36:01 -0400 Subject: [PATCH] identicon integration for twitter + fixing missing social icons for registration page --- public/templates/register.tpl | 6 +++--- src/user.js | 14 +++++--------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/public/templates/register.tpl b/public/templates/register.tpl index fdf65eb37b..2bdfb53828 100644 --- a/public/templates/register.tpl +++ b/public/templates/register.tpl @@ -11,9 +11,9 @@

Alternative Registration

diff --git a/src/user.js b/src/user.js index 06f18e2431..99b3de12ae 100644 --- a/src/user.js +++ b/src/user.js @@ -330,15 +330,11 @@ var utils = require('./../public/src/utils.js'), }; User.createGravatarURLFromEmail = function(email) { - if(email) { - var md5sum = crypto.createHash('md5'); - md5sum.update((email || '').toLowerCase()); - var gravatarURL = 'http://www.gravatar.com/avatar/' + md5sum.digest('hex'); - return gravatarURL; - } - else { - return "http://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e"; - } + if (!email) email = utils.generateUUID(); + var md5sum = crypto.createHash('md5'); + md5sum.update(email).toLowerCase().trim(); + var gravatarURL = 'http://www.gravatar.com/avatar/' + md5sum.digest('hex'); + return gravatarURL; } User.hashPassword = function(password, callback) {