# Auth0 and react Application

**URL:** <https://community.auth0.com/t/auth0-and-react-application/60539>\
**Category:** Get Help\
**Created:** [April 5, 2021, 12:44am UTC](https://community.auth0.com/t/auth0-and-react-application/60539 "2021-04-05T00:44:28Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![tandan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tandan/32/28575_2.png) [@tandan](https://community.auth0.com/u/tandan)\
**Post date:** [April 5, 2021, 12:44am UTC](https://community.auth0.com/t/auth0-and-react-application/60539/1 "2021-04-05T00:44:28Z")

</div>

Hello Everyone! I am new to auth0 and I’m trying to implement it within my react application. How does my application know who has logged in so I can pull relevant user data from my database after auth0 authentication. So the user hits login —\> authenticates (or creates a new account) via auth0 —\> get redirected to my app (the page i specify in settings) but how does my application know who has logged in? Thanks!

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 5, 2021, 7:31pm UTC](https://community.auth0.com/t/auth0-and-react-application/60539/3 "2021-04-05T19:31:47Z")

</div>

Hi @tandan,

Welcome to the Community!

The ID token will provide your react app with information about the user.

Take a look at our quickstart that walks through the Auth0 React SDK.

---

<div class="post-metadata">

**Author:** ![tandan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tandan/32/28575_2.png) [@tandan](https://community.auth0.com/u/tandan)\
**Post date:** [April 5, 2021, 8:19pm UTC](https://community.auth0.com/t/auth0-and-react-application/60539/4 "2021-04-05T20:19:12Z")

</div>

Thanks Dan! I will take a look.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 5, 2021, 8:44pm UTC](https://community.auth0.com/t/auth0-and-react-application/60539/5 "2021-04-05T20:44:06Z")

</div>

Let us know if you have any additional questions!

---

<div class="post-metadata">

**Author:** ![tandan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tandan/32/28575_2.png) [@tandan](https://community.auth0.com/u/tandan)\
**Post date:** [April 5, 2021, 11:05pm UTC](https://community.auth0.com/t/auth0-and-react-application/60539/6 "2021-04-05T23:05:21Z")

</div>

Hey Dan, I was able to pull the user data per the instructions in the React SDK… currently, the name of the user is the email address. is there a way to have auth0 ask for the name or perhaps make a post request to update the name into the users profile? Also, I have required username, but im unable to get it to render in the profile component?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 6, 2021, 4:22pm UTC](https://community.auth0.com/t/auth0-and-react-application/60539/7 "2021-04-06T16:22:11Z")

</div>

> [@tandan](#):
>
> is there a way to have auth0 ask for the name or perhaps make a post request to update the name into the users profile?

You can send a patch request to update the user’s name with the [update users endpoint](https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id).

This should be done from your backend/API.

> [@tandan](#):
>
> Also, I have required username, but im unable to get it to render in the profile component?

Can you show us what you are doing and why it is not working? Is it being returned in the token?

---

<div class="post-metadata">

**Author:** ![tandan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tandan/32/28575_2.png) [@tandan](https://community.auth0.com/u/tandan)\
**Post date:** [April 6, 2021, 4:49pm UTC](https://community.auth0.com/t/auth0-and-react-application/60539/8 "2021-04-06T16:49:32Z")

</div>

Hi Dan, I have configured my sign in to ask for a username. Im simply trying to pull the username into my page. The name and image are being pulled fine and are being rendered. I have used conditional rendering to show the login/logout button. Perhaps, its not possible to pull the username this way, and i would need to fetch this information?

 ![auth0](https://global.discourse-cdn.com/auth0/original/3X/1/c/1c1e025606dc2f92c9a2292b66869ed042937b20.jpeg)

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 6, 2021, 4:53pm UTC](https://community.auth0.com/t/auth0-and-react-application/60539/9 "2021-04-06T16:53:15Z")

</div>

Is it available in the ID token?

---

<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:** [April 21, 2021, 4:53pm UTC](https://community.auth0.com/t/auth0-and-react-application/60539/10 "2021-04-21T16:53:48Z")

</div>

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