# React hosted login first login screen

**URL:** <https://community.auth0.com/t/react-hosted-login-first-login-screen/8872>\
**Category:** Get Help\
**Tags:** hosted-login, spa, react, signup\
**Created:** [December 3, 2017, 5:20am UTC](https://community.auth0.com/t/react-hosted-login-first-login-screen/8872 "2017-12-03T05:20:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![james.heggs](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@james.heggs](https://community.auth0.com/u/james.heggs)\
**Post date:** [December 3, 2017, 5:20am UTC](https://community.auth0.com/t/react-hosted-login-first-login-screen/8872/1 "2017-12-03T05:20:46Z")

</div>

**Auth0 Setup:** Hosted Login

**Environment:** React SPA

Is it possible to hit a different callback page (to the standard login) when a user signs up through the hosted login screen?

Ideally I’d like the user to see an ‘initial setup’ screen that only appears once on their first login.

I’ve looked at the following which can help identify whether its their first login but just seeing if the community have particular best practice implementations for this.

> <https://stackoverflow.com/questions/40250292/user-signup-event-in-auth0-lock>

---

<div class="post-metadata">

**Author:** ![james.heggs](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@james.heggs](https://community.auth0.com/u/james.heggs)\
**Post date:** [December 3, 2017, 5:54am UTC](https://community.auth0.com/t/react-hosted-login-first-login-screen/8872/2 "2017-12-03T05:54:28Z")

</div>

For anyone interested I created a rule like this:

```
function (user, context, callback) {
  user.app_metadata = user.app_metadata || {};

  console.log(user.app_metadata.first_login);

  if (user.app_metadata.first_login) {
    
    console.log('User has signed in before');
    
    user.app_metadata.first_login = false;
    
    auth0.users.updateAppMetadata(user.user_id, user.app_metadata)
    .then(function(){
      callback(null, user, context);
    })
    .catch(function(err){
      callback(err);
    });
  }
  else if(user.app_metadata.first_login === undefined) {
    
    console.log('User first login');
    
    user.app_metadata.first_login = true;
    
    auth0.users.updateAppMetadata(user.user_id, user.app_metadata)
    .then(function(){
      callback(null, user, context);
    })
    .catch(function(err){
      callback(err);
    });
  }
  else {
    
    console.log('User standard login');
    
    return callback(null, user, context);
  }
}

```

I can then use that meta data upon in the Authentication service to send the user to the first login page as necessary.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:57am UTC](https://community.auth0.com/t/react-hosted-login-first-login-screen/8872/3 "2018-03-02T05:57:37Z")

</div>


