auto-assign profile pic
This commit is contained in:
parent
a632baf6cb
commit
d4af131481
@ -137,6 +137,7 @@
|
|||||||
oAuthid: profile.id,
|
oAuthid: profile.id,
|
||||||
handle: profile.displayName,
|
handle: profile.displayName,
|
||||||
email: profile.emails[0].value,
|
email: profile.emails[0].value,
|
||||||
|
picture: profile.picture,
|
||||||
isAdmin: profile.isAdmin
|
isAdmin: profile.isAdmin
|
||||||
}, function(err, user) {
|
}, function(err, user) {
|
||||||
if (err) {
|
if (err) {
|
||||||
@ -175,6 +176,7 @@
|
|||||||
profile.displayName = data.display_name;
|
profile.displayName = data.display_name;
|
||||||
profile.emails = [{ value: data.email }];
|
profile.emails = [{ value: data.email }];
|
||||||
profile.isAdmin = data.privilege === 5;
|
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...
|
// Do you want to automatically make somebody an admin? This line might help you do that...
|
||||||
// profile.isAdmin = data.isAdmin ? true : false;
|
// profile.isAdmin = data.isAdmin ? true : false;
|
||||||
@ -225,7 +227,8 @@
|
|||||||
if (!uid) {
|
if (!uid) {
|
||||||
User.create({
|
User.create({
|
||||||
username: payload.handle,
|
username: payload.handle,
|
||||||
email: payload.email
|
email: payload.email,
|
||||||
|
picture: payload.picture
|
||||||
}, function(err, uid) {
|
}, function(err, uid) {
|
||||||
if(err) {
|
if(err) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
|
Loading…
Reference in New Issue
Block a user