-
Notifications
You must be signed in to change notification settings - Fork 12
Log Out Users
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!
© Wappler 2018
- Home
- Getting Started
- How-to Guides
- Project Manager
- Bootstrap 4 Visual Designer
- Image Galleries & Animations
-
Server-side Components
- Connecting to a Database
- Creating Database Queries
- Binding Data on the Page
- Formatting Dynamic Data
- Filter Data with Text Input
- Filter Data with URL Param
- Dynamic Select Menu
- Dynamic Sortable Table
- Dynamic Paging
- Server Side Includes (SSI)
- Insert Database Record
- Get Inserted Record ID
- Delete Database Record
- JSON Data Sources
- Send Form to Email
- Debugging Problems
- Security & Login
- Form & Data Validation
- Notifications & Alerts
- Mobile Apps