Add ToS to the Signup Screen using Forms for Actions

Good morning, I’ve seen this solution:

The issue I see is that there’s no way for the user to decline the ToS and then proceed to delete their Auth0 account…

What I tried was adding a jump button that triggers an action, which in turn calls an API with the user_id to delete the Auth0 user. The problem is that the form continues its flow, and after deleting the Auth0 user, it shows an error page.

So I don’t see how, if the user registers and doesn’t want to accept the ToS, their data is still registered in Auth0 anyway.

Can someone help me with this?

Best regards and thanks in advance.

Hi @tagy,

I have reviewed your Forms flow and understand that you are trying to delete the user if they do not agree to the terms and conditions of your app.

Unfortunately, this approach will lead to an error page at the end of the login flow, which is unavoidable. As a workaround, you could deny the user access or redirect them to log out rather than deleting them. This way, the users can still have a chance to accept the ToS rather than creating their whole account again.

For example:

api.access.deny(`Please accept the Terms and Conditions to continue to ${event.client.name}`);

Or

api.redirect.sendUserTo('https://{auth0_tenant}.us.auth0.com/v2/logout?returnTo=https://example.com')

Let me know if you have any follow-up questions.

Cheers,
Rueben

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