diff --git a/auth-web/src/routes/index.ts b/auth-web/src/routes/index.ts index ae1deb2448..33a2d86dba 100644 --- a/auth-web/src/routes/index.ts +++ b/auth-web/src/routes/index.ts @@ -16,6 +16,7 @@ import Router from 'vue-router' import { User } from '@/models/user' import Vue from 'vue' import { getRoutes } from './router' +import { handleExternalLinkRedirect } from '@/util/navigation' import store from '@/stores/vuex' import { useOrgStore } from '@/stores/org' import { useUserStore } from '@/stores/user' @@ -173,6 +174,10 @@ router.beforeEach(async (to, from, next) => { return next({ path: `/${Pages.UPDATE_ACCOUNT}` }) } } + + if (handleExternalLinkRedirect(to.fullPath)) { + return + } next() } }) diff --git a/auth-web/src/util/navigation.ts b/auth-web/src/util/navigation.ts index 4741adf83b..740835f422 100644 --- a/auth-web/src/util/navigation.ts +++ b/auth-web/src/util/navigation.ts @@ -55,3 +55,12 @@ export const goToFormPage = (entityType): void => { export const goToSocieties = (): void => { window.open(appendAccountId(ConfigHelper.getSocietiesUrl()), '_blank') } + +export const handleExternalLinkRedirect = (path: string): boolean => { + if (path.includes('/http')) { + const cleanPath = path.replace(/^\//, '') + window.location.href = cleanPath + return true + } + return false +}