Skip to content

Commit

Permalink
Merge pull request #347 from ymaheshwari1/launchpad-118
Browse files Browse the repository at this point in the history
Fixed: issue in redirection using back button from the app to launchpad
  • Loading branch information
ymaheshwari1 authored Nov 4, 2024
2 parents a076bf5 + 43ff78a commit 94f43a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
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

0 comments on commit 94f43a6

Please sign in to comment.