Browse Source

refactor: redirect even if

pull/9540/head
Pranav C 2 months ago
parent
commit
245fd3262d
  1. 4
      packages/nc-gui/plugins/redirect.ts

4
packages/nc-gui/plugins/redirect.ts

@ -29,7 +29,9 @@ export default defineNuxtPlugin(function (nuxtApp) {
() => token.value ?? (nuxtApp.$state as ReturnType<typeof useGlobal>)?.token?.value, () => token.value ?? (nuxtApp.$state as ReturnType<typeof useGlobal>)?.token?.value,
async (newToken, oldToken) => { async (newToken, oldToken) => {
try { try {
if (newToken && newToken !== oldToken && isTokenUpdatedTab.value) { // if token updated and continueAfterSignIn query param is present, redirect to that page
// or if token updated and isTokenUpdatedTab is true, redirect to the page stored in localStorage
if (newToken && newToken !== oldToken && (isTokenUpdatedTab.value || route.value.query?.continueAfterSignIn)) {
try { try {
if (route.value.query?.continueAfterSignIn) { if (route.value.query?.continueAfterSignIn) {
await navigateTo(route.value.query.continueAfterSignIn as string, { await navigateTo(route.value.query.continueAfterSignIn as string, {

Loading…
Cancel
Save