Capture data on whether user has agreed to terms of service


I have a custom login form. I’m having users open the ToS in a new modal, with the checkbox at the bottom of the modal. I need to capture whether user has agreed to ToS (that is, selected the checkbox).

Before, I gated the Login button in the form itself, so it is disabled if user hasnt selected the ToS. But now, I need user to select ToS every year. Hence, my new approach is:

  1. Add “Read our Terms of Service and User Agreement” link at the bottom of login box.
  2. When user clicks on Terms of Service link, open a Modal with ToS and a checkbox “Agree to ToS”.
  3. Capture whether user has agreed to the ToS or not (checkbox.checked).
  4. In Post-Login actions, check whether user has agreed to ToS or not.
    4.A. If user has accepted ToS, set the “tos_accepted” date in user_metadata.
    4.B. If not, check if user has accepted before in the past year. If yes, allow user to login. If not, throw an api.deny error that user needs to accept ToS again. (There’s also a bit that checks if this is user’s first login and if they have accepted ToS, but that’s irrelevant for this discussion).

I’m looking for a way to capture data from custom login form and send it to Post Login Actions.

I tried Lock but it was very confusing to me. Especially since I would need ToS to be accepted annually instead of just at sign up. It doesnt fit my needs.

Hi @charvi.virani

Welcome back to the Auth0 Community!

Thank you for posting your question. Currently, the flow can, with some flows, be achieved with progressive profiling. You would need to conditionally redirect users with Post Login Action after logging in to your page with the TOS they would accept. However, we currently have a new feature you may be interested in in a private beta. Forms for Actions would make it possible to achieve the described flow in an almost plug-and-play fashion. You can read more about it here → Forms for Actions

And more about progressive profiling here → Understand How Progressive Profiling Works

I hope this will help you.


1 Like

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