mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-05 22:38:48 +00:00
Feature :: Logout event handler addition (#2651)
* logout action initial * updating logout action * removing options * removing unwanted logs :: cleanup
This commit is contained in:
parent
fff9d2afe7
commit
7d0139e0df
2 changed files with 14 additions and 0 deletions
|
|
@ -4,6 +4,10 @@ export const ActionTypes = [
|
|||
id: 'show-alert',
|
||||
options: [{ name: 'message', type: 'text', default: 'Message !' }],
|
||||
},
|
||||
{
|
||||
name: 'Logout',
|
||||
id: 'logout',
|
||||
},
|
||||
{
|
||||
name: 'Run Query',
|
||||
id: 'run-query',
|
||||
|
|
|
|||
|
|
@ -160,6 +160,13 @@ function showModal(_ref, modal, show) {
|
|||
return Promise.resolve();
|
||||
}
|
||||
|
||||
function logoutAction(_ref) {
|
||||
localStorage.clear();
|
||||
_ref.props.history.push('/login');
|
||||
window.location.href = '/login';
|
||||
|
||||
return Promise.resolve();
|
||||
}
|
||||
function executeAction(_ref, event, mode, customVariables) {
|
||||
console.log('nopski', customVariables);
|
||||
if (event) {
|
||||
|
|
@ -187,6 +194,9 @@ function executeAction(_ref, event, mode, customVariables) {
|
|||
const { queryId, queryName } = event;
|
||||
return runQuery(_ref, queryId, queryName, true, mode);
|
||||
}
|
||||
case 'logout': {
|
||||
return logoutAction(_ref);
|
||||
}
|
||||
|
||||
case 'open-webpage': {
|
||||
const url = resolveReferences(event.url, _ref.state.currentState, undefined, customVariables);
|
||||
|
|
|
|||
Loading…
Reference in a new issue