Overview
This article will describe how to allow users to logout while in the Forms for Actions prompt.
Applies To
- Forms for Actions
Solution
It is possible to allow the users to logout while they are in the middle of the Forms for Actions using the following workaround:
In the Forms editor, create an HTML Block Element with the below code, which, once clicked, will log the user out and redirect the user.
Code Sample:
<a
href="https://Your-Domain.com/v2/logout?returnTo=http://localhost:3000/"
class="logout-button"
style="cursor: pointer; padding: 10px 20px; background-color: #007bff; color: white; text-align: center; border-radius: 5px; font-size: 16px; font-weight: bold; display: inline-block; width: 200px; text-decoration: none; transition: background-color 0.3s ease;">
Logout
</a>
Preview of Forms for Action
Please note that this is an example. It is recommended to test this in lower environments before deploying to production.