# Setting user profile image

**URL:** https://discourse.nodered.org/t/setting-user-profile-image/87919
**Category:** General
**Tags:** node-red-dashboard
**Created:** [13 May 2024 16:37 UTC](https://discourse.nodered.org/t/setting-user-profile-image/87919 "2024-05-13T16:37:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![malee](https://avatars.discourse-cdn.com/v4/letter/m/ac8455/32.png) [@malee](https://discourse.nodered.org/u/malee)
#### Post date: [13 May 2024 16:37 UTC](https://discourse.nodered.org/t/setting-user-profile-image/87919/1 "2024-05-13T16:37:54Z")

</div>

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

It is noticeable that when the [node red auth github](https://www.npmjs.com/package/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:

```auto
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

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [13 May 2024 17:06 UTC](https://discourse.nodered.org/t/setting-user-profile-image/87919/2 "2024-05-13T17:06:26Z")

</div>

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

---

<div class="post-metadata">

### Author: ![malee](https://avatars.discourse-cdn.com/v4/letter/m/ac8455/32.png) [@malee](https://discourse.nodered.org/u/malee)
#### Post date: [14 May 2024 08:03 UTC](https://discourse.nodered.org/t/setting-user-profile-image/87919/3 "2024-05-14T08:03:37Z")

</div>

Thanks 🙂 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

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

```

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [12 August 2024 08:04 UTC](https://discourse.nodered.org/t/setting-user-profile-image/87919/4 "2024-08-12T08:04:33Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
