auto-assign profile pic

This commit is contained in:
Evert Prants 2017-09-07 00:06:17 +03:00
parent a632baf6cb
commit d4af131481
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
1 changed files with 4 additions and 1 deletions

View File

@ -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);