Setting user profile image

I am experimenting with passport.js and the Node-RED login.

It is noticeable that when the node red auth github package is used the users avatar is imported. However if GiHub is used as the authentication source with passport no avatar is imported.

Is there a way of defining the avatar URL in the strategies verify callback, for example:

verify: function (accessToken, refreshToken, profile, done) {
          profile.username = profile.displayName;
          profile.avatarURL = profile._json.avatar_URL;
          done(null, profile);
        },

or is it done in the callback function added to the users property

From memory, I think you should set profile.image in the verify callback.

Thanks :slight_smile: I came to that conclusion eventually! so will test on 3.1.9 and 4.0.0-beta see what happens.

... I tried this and no avavtar was added

verify: function (accessToken, refreshToken, profile, done) {
          profile.username = profile.displayName;
          profile.image = profile._json.avatar_URL;
          done(null, profile);
        },