Rolling back a signup

I was wondering if there is some way to wrap a signup in a transaction, as it were. For example, our signup process takes 2 steps. When a user clicks submit on our signup form we…

  1. We send a request to Auth0 to sign the user up
  2. We take the Auth0 id from the previous step and send a request to our API to do other sign up stuff.

If step 2 fails, I don’t want the user to be created in our Auth0 database. So, how I can I rollback a signup if part of the sign up process fails? Is deleting the user the only option?

1 Like

Hi @nick.gieschen,

Would you mind providing more info on how you have implemented step 2? If you are using a post-login Action or Rule, then the user would not be allowed access to the app, although the user would be created.

I don’t believe there is a way to add a user in something like a DB transaction, but there is a delete user endpoint that you could probably use if step 2 fails ( DELETE/api/v2/users/{id}

What we’re actually doing in step two is not relevant. My issue is that if there is any error in the post signup flow, the user still exists. Therefore, I can’t display a message to my user like “Please try registering again”, since if they try again, there will be a conflict since their email already exists.

I guess deleting the user is the only alternative.

Yes, I think deleting the user would be the only alternative in that case.