# Update and delete user profile with Auth0 (React + express)

**URL:** <https://community.auth0.com/t/update-and-delete-user-profile-with-auth0-react-express/84223>\
**Category:** Get Help\
**Tags:** api, react, express, auth0\
**Created:** [May 29, 2022, 2:07pm UTC](https://community.auth0.com/t/update-and-delete-user-profile-with-auth0-react-express/84223 "2022-05-29T14:07:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![marta.elisabet](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marta.elisabet/32/33197_2.png) [@marta.elisabet](https://community.auth0.com/u/marta.elisabet)\
**Post date:** [May 29, 2022, 2:07pm UTC](https://community.auth0.com/t/update-and-delete-user-profile-with-auth0-react-express/84223/1 "2022-05-29T14:07:54Z")

</div>

Hi! I’m building a webpage with React frontend and Express backend for an advanced web programming course in school. I’ve used Auth0 for login/logout and followed the Auth0providerwithhistory guide ([Redirecting...](https://l.messenger.com/l.php?u=https%3A%2F%2Fgithub.com%2Fauth0-blog%2Fauth0-react-sample-classes&h=AT1YPYI-zEtdTBIE-fvaWEA6tNYYLAXtCrlf-0JhcwMxMWFYZeJYWtO8sH5EAleL1NlNZRoMKCUDGzO6LswZ79OwwVGZZVdr9zJS9bIy3mCfW7jWYEzbv28jDGzpc-BiJ8vliTEv)) and that works perfectly.

Now I’m trying to make a profile side where the user can view their username, email and if they’re verified. I have two button under this information where I like the user to be able to update information such as username, email and password and one button where they can delete their account.

I have tried to make this code in express backend to delete account but don’t know if its correct and what to write in frontend to get the user id and such things.

 ![Skärmavbild 2022-05-29 kl. 16.04.16](https://global.discourse-cdn.com/auth0/original/3X/2/7/2777818a41ca50b0387404e525026b79f14ad641.png)

 ![Skärmavbild 2022-05-29 kl. 16.06.07](https://global.discourse-cdn.com/auth0/original/3X/f/e/fe6fbe04dded83c0b27578a658c750a2783f5bb9.png)

Would appreciate all help I can get very new on react, express and auth0 so if anyone has any code example it would be great.

---

<div class="post-metadata">

**Author:** ![marta.elisabet](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marta.elisabet/32/33197_2.png) [@marta.elisabet](https://community.auth0.com/u/marta.elisabet)\
**Post date:** [May 29, 2022, 2:59pm UTC](https://community.auth0.com/t/update-and-delete-user-profile-with-auth0-react-express/84223/2 "2022-05-29T14:59:31Z")

</div>

Tried this but getting this error. I send in user.user\_id as deleteID.

 ![Skärmavbild 2022-05-29 kl. 16.56.46](https://global.discourse-cdn.com/auth0/original/3X/5/5/55a4516e7cd81c1335c21732179f5e7b899f11a9.png)

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [October 21, 2024, 11:30pm UTC](https://community.auth0.com/t/update-and-delete-user-profile-with-auth0-react-express/84223/4 "2024-10-21T23:30:29Z")

</div>

Hi @marta.elisabet,

I have reviewed your code, and it looks correct. However, at the time of writing this reply, we have updated our docs to use the [`management.users.delete()`](https://auth0.github.io/node-auth0/classes/management.UsersManager.html#delete) method.

For your `500` undefined error, I recommend checking your [Auth0 Logs](https://manage.auth0.com/#/logs) for clues in the error details. It would be best if you also verified that your access token has the required scopes for the Management API [delete a user](https://auth0.com/docs/api/management/v2/users/delete-users-by-id) endpoint, specifically `delete:users` and `delete:current_user`.

Thanks,  
Rueben

---

<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:** [November 4, 2024, 11:31pm UTC](https://community.auth0.com/t/update-and-delete-user-profile-with-auth0-react-express/84223/5 "2024-11-04T23:31:06Z")

</div>

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