Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: issue in redirection using back button from the app to launchpad #347

Merged
merged 2 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/components/DxpLogin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const error = ref({

onMounted(async () => {
if (!Object.keys(route.query).length) {
window.location.href = context.appLoginUrl
window.location.replace(context.appLoginUrl)
return
}

Expand All @@ -73,7 +73,7 @@ async function handleUserFlow(token: string, oms: string, expirationTime: string
console.error('User token has expired, redirecting to launchpad.')
error.value.message = 'User token has expired, redirecting to launchpad.'
const redirectUrl = window.location.origin + '/login' // current app URL
window.location.href = `${context.appLoginUrl}?isLoggedOut=true&redirectUrl=${redirectUrl}`
window.location.replace(`${context.appLoginUrl}?isLoggedOut=true&redirectUrl=${redirectUrl}`)
return
}

Expand Down Expand Up @@ -105,8 +105,7 @@ async function handleUserFlow(token: string, oms: string, expirationTime: string
notificationContext.addNotification,
)
}

redirectRoute ? router.push(redirectRoute) : router.push('/')
router.replace(redirectRoute ? redirectRoute : '/')
} catch (err: any) {
console.error(err)
error.value.message = 'Please contact the administrator.'
Expand All @@ -117,7 +116,7 @@ async function handleUserFlow(token: string, oms: string, expirationTime: string
}

function goToLaunchpad() {
window.location.href = `${process.env.VUE_APP_LOGIN_URL}`
window.location.replace(process.env.VUE_APP_LOGIN_URL)
}
</script>

Expand Down
2 changes: 1 addition & 1 deletion src/components/DxpUserProfile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const logout = () => {

appState.dispatch('user/logout').then(() => {
const redirectUrl = window.location.origin + '/login'
window.location.href = `${appLoginUrl}?isLoggedOut=true&redirectUrl=${redirectUrl}`
window.location.replace(`${appLoginUrl}?isLoggedOut=true&redirectUrl=${redirectUrl}`)
})
}

Expand Down
Loading