Hi Trishla,
you can do this by adding decision to check whether the entered OTP is correct or wrong.
If true, then perform next action.
If false, then simply call Java action to logout.
You should use a nanoflow behind the 'submit' button for the correct OTP code. Check the code within this nanoflow (or a submicroflow) and in the nanoflow you can sign out a user.
Ps. As a side node. You cannot log out anonymous users. If the user first opens the page and he receives an OTP, you could create a specifc user role for this type of user. He is logged in (he has identified himself with an e-mail address), but he still needs to prove it.
Hi Trishla,
I understood that you don't want to write any java action to SignOut.
It's ok, then create a nanoflow to trigger and call a javascript action which is already present in the application,
just search "Sign out" and you can have it.
but one thing to let you know that you cannot Logout the Anonymous Users.
Be clear on what you want to do, just like you want to create a new session for the user by entering wrong OTP or you just want to redirect to the same page with refresh action.
Hope this helps Trishla.