| 12345678910111213141516171819202122232425 |
- import UrlUtils from '~/services/utils/urlUtils'
- export const useRedirect = () => {
- const runtimeConfig = useRuntimeConfig()
- const redirectToLogout = () => {
- if (!runtimeConfig.baseUrlAdminLegacy) {
- throw new Error('Configuration error : no redirection target')
- }
- navigateTo(UrlUtils.join(runtimeConfig.baseUrlAdminLegacy, '#/logout'), {
- external: true,
- })
- }
- const redirectToHome = () => {
- if (!runtimeConfig.baseUrlAdminLegacy) {
- throw new Error('Configuration error : no redirection target')
- }
- navigateTo(UrlUtils.join(runtimeConfig.baseUrlAdminLegacy, '#/dashboard'), {
- external: true,
- })
- }
- return { redirectToLogout, redirectToHome }
- }
|