How to verify the OTP up to three times; if unsuccessful, navigate to the login page

In an application that uses a One-Time Password (OTP) for authentication. I want to implement a feature where users are automatically redirected to the login page if they enter the wrong OTP three times.

@AnushkaGupta

  1. Create an entity with the following data:
  2. {"flag": "4"}
    

Screenshot from 2024-06-03 16-25-16

  1. Map the copy data task to the OnPageCreate event.

  2. In the “copy from” tab, enter Static(0, string) and in the “copy to” tab, enter flag.

  3. Map the copy data task to the OnCompletion event of the OTP element.

  4. In the “copy from” tab, enter SUM(CAST(flag, Number), Static(1, string)) and in the “copy to” tab, enter flag.

  5. Note: This sum function increments the value by one on every completion of the OTP element.

  6. Set the navigate task with a Business Rule Engine (BRE) condition: if flag equals Static(3, string).

Also, If these steps resolve your query please mark it as a solution.

2 Likes

Just an explanation on what Ritik is trying to do here.

  1. Create an entity to store local count
  2. Reset the flag count to 0 on page load
  3. increase the entity flag by 1 on each unsuccessful otp
  4. Create the Business Rule to check the flag = 3
  5. apply this rule on completion
3 Likes