From 8be7018543b4616939b027cd61290ce61a36c75d Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 19 Jan 2022 12:50:07 +0000 Subject: [PATCH] Rename return URL to redirect URL in log out action --- .../ButtonActionEditor/actions/LogOut.svelte | 6 +++--- packages/client/src/utils/buttonActions.js | 12 +++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/LogOut.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/LogOut.svelte index 37dac8ebc0..f0606d86b3 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/LogOut.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/LogOut.svelte @@ -13,11 +13,11 @@ If you don't enter a value, you'll be redirected to the login screen.
- + (parameters.returnUrl = value.detail)} + value={parameters.redirectUrl} + on:change={value => (parameters.redirectUrl = value.detail)} {bindings} />
diff --git a/packages/client/src/utils/buttonActions.js b/packages/client/src/utils/buttonActions.js index 1ab3b26976..2ef324d23c 100644 --- a/packages/client/src/utils/buttonActions.js +++ b/packages/client/src/utils/buttonActions.js @@ -114,13 +114,15 @@ const refreshDataProviderHandler = async (action, context) => { const logoutHandler = async action => { await authStore.actions.logOut() - let returnUrl = "/builder/auth/login" + let redirectUrl = "/builder/auth/login" let internal = false - if (action.parameters.returnUrl) { - internal = action.parameters.returnUrl?.startsWith("/") - returnUrl = routeStore.actions.createFullURL(action.parameters.returnUrl) + if (action.parameters.redirectUrl) { + internal = action.parameters.redirectUrl?.startsWith("/") + redirectUrl = routeStore.actions.createFullURL( + action.parameters.redirectUrl + ) } - window.location.href = returnUrl + window.location.href = redirectUrl if (internal) { window.location.reload() }