Looking for a Logout action

2
I noticed that there are some threads in the Forum on this, but it is not part of the Community commons. Does anyone have a "spare" Logout example for me ?
asked
2 answers
14

For a Mendix 4 example you can look at https://forum.mendix.com/questions/1933/How-would-i-logout-of-mendix-via-a-microflow

To get that to work, you can just create a Java action (returning a Boolean) of your own and copy/paste the part in between the BEGIN USER CODE and END USER CODE in the appropriate place, so it would look like this:

    // BEGIN USER CODE
    com.mendix.core.Core.logout(getContext().getSession());
    return true;
    // END USER CODE

In Mendix 5 you can even send the client a notification that the session is logged out, so it immediately resets the client instead of having to click around in order to get the client to notice the logout. For this you could add the following line of code

com.mendix.webui.FeedbackHelper.addLogoutFeedback(getContext());

(this should be on the line before the return true; statement)

answered
1

See https://forum.mendix.com/link/questions/101815 for a variant with calling mx.logout() from a nanoflow

answered