Ask AI
Skip to main content

Logout

Function: Logout

This function allows you to log out the current user from your application. After logging out, the user can be redirected to a specific page you choose, or they will automatically be sent to the application's default login page or homepage.

Input

  • Redirect to page (Type: TEMPLATE, Optional): Specify a page within your application to which the user should be redirected immediately after logging out. If you leave this field empty, the user will be redirected to the application's default login page or homepage.

Output

This function does not return any specific output. Its primary action is to log out the user and initiate a redirection within the application.

Execution Flow

Real-Life Examples

  1. Simple Logout:

    • Inputs:
      • Redirect to page: (Leave empty)
    • Result: The current user is logged out and automatically redirected to the application's default login page or homepage.
  2. Logout and Redirect to a Custom "Thank You" Page:

    • Inputs:
      • Redirect to page: ThankYouForUsingOurApp (Select a pre-defined page template named "ThankYouForUsingOurApp" from your application's available pages)
    • Result: The current user is logged out and then immediately taken to the "ThankYouForUsingOurApp" page within the application.
  3. Logout from an Admin Session to the Public Homepage:

    • Inputs:
      • Redirect to page: PublicHomepage (Select a page template named "PublicHomepage" that serves as the main entry point for non-logged-in users)
    • Result: An administrator user is logged out of their admin session and redirected to the general public homepage of the application, allowing them to browse as a guest or log in again.