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.
- Create an entity with the following data:
-
{"flag": "4"}
-
Map the copy data task to the OnPageCreate event.
-
In the “copy from” tab, enter
Static(0, string)
and in the “copy to” tab, enterflag
. -
Map the copy data task to the OnCompletion event of the OTP element.
-
In the “copy from” tab, enter
SUM(CAST(flag, Number), Static(1, string))
and in the “copy to” tab, enterflag
.
-
Note: This sum function increments the value by one on every completion of the OTP element.
-
Set the navigate task with a Business Rule Engine (BRE) condition: if
flag
equalsStatic(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.
- Create an entity to store local count
- Reset the flag count to 0 on page load
- increase the entity flag by 1 on each unsuccessful otp
- Create the Business Rule to check the flag = 3
- apply this rule on completion
3 Likes