Send data from form to onContinuePostLogin method in actions

I have got an action that opens a form using

api.prompt.render(form_id)

The form is to send an email verification link to the user’s email address, which is working fine, and in one of the steps I have got a “Custom” block with a link to allow the user’s the resume the flow and be redirected to the application.

Clicking the link triggers a bit of javascript that runs

context.form.goForward();

effectively carrying on with the flow as intended.

However, I need to track the usage of this click and I was trying to set a variable or property somewhere that I could then capture within the onContinuePostLogin method of the same action that triggers the form popup.

I tried context.custom.setValue() to set the value of the custom field but I can’t access it in the onContinuePostLogin but no luck.

Any clues on how to achieve this?

Hi @simoesj

Welcome to the Auth0 Community!

May I ask why do you need to track the click on that specific custom block?
Unfortunately, there is no method in which you are able to track if a form button is being clicked or to set a count to that. Otherwise, you can assign a flow to the specific custom block to be executed after the click if you need to set a variable within the user profile. Also, inside the action window, you can access form elements by using something like

event.prompt.fields.customFieldName

If you wish to verify the email of a new user without using a form, you can go to the Database connection that you are using for your application, go to Attributes → Email → Configure and select either OTP or Verification Link.
By selecting OTP, the users will be forced to verify the email on signup. By using the verification link, the user will be sent an email and allowed to authenticate.

As an alternative solution, by using an action you can create a job to send an email verification email if the email_verified is set to false.

If any of the solution above are not suitable or if you have any other questions, let me know!

Kind Regards,
Nik