Anonymous user logout feature

0
Hi All, There is a scenario in our application. Like there is an anonymous user, he click and a page opens to enter the otp which we already received in his mail. If he enters correct mail then can proceed , if enters wrong mail then we need to perform its session out, like user get logged out. How to implement it in mendix 10.6.4.   Please help me out, it's urgent. Thanks
asked
3 answers
0

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.

answered
0

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.

afbeelding.png

 

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.

answered
0

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.

answered