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

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...) 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.

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.

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

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() method.

For your 500 undefined error, I recommend checking your Auth0 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 endpoint, specifically delete:users and delete:current_user.

Thanks,
Rueben

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