From d4af131481699f51a466302db946b6eb6e4bf251 Mon Sep 17 00:00:00 2001 From: Evert Date: Thu, 7 Sep 2017 00:06:17 +0300 Subject: [PATCH] auto-assign profile pic --- library.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library.js b/library.js index ef86134..a2b3dec 100644 --- a/library.js +++ b/library.js @@ -137,6 +137,7 @@ oAuthid: profile.id, handle: profile.displayName, email: profile.emails[0].value, + picture: profile.picture, isAdmin: profile.isAdmin }, function(err, user) { if (err) { @@ -175,6 +176,7 @@ profile.displayName = data.display_name; profile.emails = [{ value: data.email }]; profile.isAdmin = data.privilege === 5; + profile.picture = 'https://icynet.eu/api/avatar/' + data.id // Do you want to automatically make somebody an admin? This line might help you do that... // profile.isAdmin = data.isAdmin ? true : false; @@ -225,7 +227,8 @@ if (!uid) { User.create({ username: payload.handle, - email: payload.email + email: payload.email, + picture: payload.picture }, function(err, uid) { if(err) { return callback(err);