# Default Image for User in Hosted Login Page

**URL:** <https://community.auth0.com/t/default-image-for-user-in-hosted-login-page/9811>\
**Category:** Get Help\
**Created:** [March 7, 2018, 12:30am UTC](https://community.auth0.com/t/default-image-for-user-in-hosted-login-page/9811 "2018-03-07T00:30:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![willburholt](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@willburholt](https://community.auth0.com/u/willburholt)\
**Post date:** [March 7, 2018, 12:30am UTC](https://community.auth0.com/t/default-image-for-user-in-hosted-login-page/9811/1 "2018-03-07T00:30:38Z")

</div>

The gravatar feature seems very neat and makes the login experience very personal for all users in implementing their login image. Is there a way where a **default image** could be used for users that do not have gravatar accounts so they know that they can have an avatar image?

---

<div class="post-metadata">

**Author:** ![kimcodes](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kimcodes/32/81052_2.png) [@kimcodes](https://community.auth0.com/u/kimcodes)\
**Post date:** [March 7, 2018, 1:38am UTC](https://community.auth0.com/t/default-image-for-user-in-hosted-login-page/9811/2 "2018-03-07T01:38:38Z")

</div>

👋 @willburholt

You are able to edit the default image for those who do not have one by using a custom rule.

Here’s an example:

```
function (user, context, callback) {
  if (user.picture.indexOf('cdn.auth0.com') > -1) {
    var url = require('url');
    var u = url.parse(user.picture, true);
    u.query.d = 'http://URL-TO-YOUR-DEFAULT-PICTURE';
    delete u.search;
    user.picture = url.format(u);
  }
  callback(null, user, context);
}

```

You can see more information about the user profile, in particular the `user.picture` in Auth0 [here](https://auth0.com/docs/user-profile/user-picture)  
In addition, if you’re new to rules you can explore more [here](https://auth0.com/docs/rules/current)

---

<div class="post-metadata">

**Author:** ![willburholt](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@willburholt](https://community.auth0.com/u/willburholt)\
**Post date:** [March 7, 2018, 1:48am UTC](https://community.auth0.com/t/default-image-for-user-in-hosted-login-page/9811/3 "2018-03-07T01:48:47Z")

</div>

I was referring to a default image being **displayed on the hosted login page** if they do not use gravatar. So, if a default image is set, will it show in the place for their image (like this: [https://cdn2.auth0.com/docs/media/articles/libraries/lock/customization/gravatar.png](https://cdn2.auth0.com/docs/media/articles/libraries/lock/customization/gravatar.png))?

---

<div class="post-metadata">

**Author:** ![kimcodes](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kimcodes/32/81052_2.png) [@kimcodes](https://community.auth0.com/u/kimcodes)\
**Post date:** [March 14, 2018, 7:31pm UTC](https://community.auth0.com/t/default-image-for-user-in-hosted-login-page/9811/4 "2018-03-14T19:31:43Z")

</div>

Hi willburholt,

You’re right, my previous message was for the application and not the hosted login page.

For the hosted login page, one of the options available if you’re using [Lock](https://auth0.com/docs/libraries/lock/v11) is the [avatar](https://auth0.com/docs/libraries/lock/v11/configuration#avatar-object-) field. It is possible to configure this option to show in place either a fallback image if the user doesn’t have a Gravatar profile or from a non gravatar source. Please note if you are generating a default image we’d recommend doing so in a way that does not require user information to generate as this could expose data when doing so.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [July 25, 2019, 11:06am UTC](https://community.auth0.com/t/default-image-for-user-in-hosted-login-page/9811/5 "2019-07-25T11:06:42Z")

</div>


