Skip to content

Log Out Users

teodorpk edited this page Jun 14, 2018 · 2 revisions

In order to log users out you need to create a server action and link it to a Log Out button, so that when clicked it logs users out.

First, create a new server action:

We call it logOut:

Right click its steps:

Open security provider group:

And add Security Provider:

Click the load icon (1) and select the security provider you linked for your site (2):

Then right click the security provider step:

Open the security provider group:

And add Security Log Out:

Save your server action and we are done with the server-side part:

On your page select App in the App Structure:

Add new component (1) and open the Data group (2):

Add server connect:

Then click the select server action button:

And select the logOut action we've just created:

This is really important - do not forget to turn the NO AUTO LOAD option on. This will prevent server action from auto executing when the page loads. You don't want to load the log out action, when the people load your page, right?

We want it to run only, when the log out button is clicked. So - select the log out button (1) and add dynamic event (2):

Select mouse:

And then on click:

Click the dynamic action picker button:

And under the logout server connect component, select Load (1) and click the Add button (2):

Click the select button, when you are done:

Now, as we are done setting up the log out action and button - let's add a redirect when the user logs out. Select App in the App structure:

Add new component (1) and open the Browser group:

Add Browser component:

And select your logOut server action:

Add new dynamic event:

Open the server connect group:

And select on Success:

Select a dynamic event to run on success:

Under the Browser component select Go To (1) and click the Add button (2):

Enter the page where users should be redirected on log out. If you are entering a static value, you must wrap it in single quotes like: 'page.html':

And you are done!

Clone this wiki locally