Skip to content

Commit

Permalink
Improved: used replace method in place of href for logout cases as well
Browse files Browse the repository at this point in the history
  • Loading branch information
ymaheshwari1 committed Oct 29, 2024
1 parent 24ed420 commit 43ff78a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 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 @@ -116,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

0 comments on commit 43ff78a

Please sign in to comment.