Insites Docs Developers guide Data and UsersUsersLogging Out an Authenticated User

Logging Out an Authenticated User

Last updated on June 26, 2024.

This guide helps you create an authentication form to log out authenticated users.

Prerequisites

To follow the steps in this tutorial, you should understand the required directory structure for your codebase and the concept of pages and users. In addition, you need to understand the difference between Production and Staging Instaces.

Steps

Logging out an authenticated user is a two-step process:

  • Step 1: Create a log-out form
  • Step 2: Embed the log-out form

Step 1: Create the Log Out Form

app/forms/log_out.liquid

The difference between logging in and logging out is that you want to destroy the session with the latter. You must send a request by providing the attribute to the tag.

Step 2: Embed the Log Out Form

app/views/pages/log-out.liquid

Note

To set an expiration for user sessions, follow the steps outlined in the 'User Session Timeout' section of the Updating Instance Configuration tutorial.

Next Steps

Congratulations! You created a log-out for authenticated users. Now you can learn about resetting a user's password: Resetting the Password of an Authenticated User.

Have a suggestion for this page?

Didn't quite find what you are looking for or have feedback on how we can make the content better then we would love to hear from you. Please provide us feedback and we will get back to you shortly.