ToolJet/docs/versioned_docs/version-3.16.0-LTS/actions/logout.md

38 lines
1.5 KiB
Markdown
Raw Normal View History

2025-08-04 06:49:49 +00:00
---
id: logout
title: Logout
---
2026-04-20 09:33:19 +00:00
The **Logout** action logs the current user out of their active ToolJet workspace session. It clears all locally stored session data and redirects the user to the login page. Use this action to build secure logout flows triggered by buttons, timers, or any component event.
## Configuration
| Parameter | Description | Default |
|-----------|-------------|---------|
| Debounce | Time in milliseconds to wait before executing the action | Empty (no delay) |
Set a numeric value in the **Debounce** field to delay the logout. For example, entering `300` will trigger the logout after 300ms.
<img className="screenshot-full img-l" src="/img/actions/logout/logout2.png" alt="ToolJet - Action reference - Logout" style={{marginBottom:'15px'}} />
## Behavior
- Clears all locally stored session data.
- Redirects the user to the workspace login page upon logout.
2025-08-04 06:49:49 +00:00
:::info Standalone App URLs
2026-04-20 09:33:19 +00:00
If your application is accessed via a standalone URL, logging out redirects the user back to the app-specific login page rather than the workspace login page. See [Authentication for Standalone Application URLs](/docs/development-lifecycle/release/share-app#authentication-for-standalone-application-urls) for more details.
:::
2026-04-20 09:33:19 +00:00
## Triggering via RunJS
You can trigger the logout action programmatically from a RunJS query:
```js
await actions.logout();
```
2025-08-04 06:49:49 +00:00
:::info
2026-04-20 09:33:19 +00:00
For a full guide on triggering actions from RunJS, see [Run Actions from RunJS](/docs/how-to/run-actions-from-runjs).
2025-08-04 06:49:49 +00:00
:::