From e215d5781b1bf3285ba60fb3381f0e460204e6b2 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Mon, 23 Sep 2024 10:12:16 +0000 Subject: [PATCH] refactor: redirect even if --- packages/nc-gui/plugins/redirect.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/plugins/redirect.ts b/packages/nc-gui/plugins/redirect.ts index cfa3bd5a8e..20801a662c 100644 --- a/packages/nc-gui/plugins/redirect.ts +++ b/packages/nc-gui/plugins/redirect.ts @@ -29,8 +29,9 @@ export default defineNuxtPlugin(function (nuxtApp) { () => token.value ?? (nuxtApp.$state as ReturnType)?.token?.value, async (newToken, oldToken) => { try { - // 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 token updated redirect if one of the following condition matches, + // 1. `continueAfterSignIn` query param is present in the url + // 2. If signin happened in current tab which can be detected by `isTokenUpdatedTab` flag if (newToken && newToken !== oldToken && (isTokenUpdatedTab.value || route.value.query?.continueAfterSignIn)) { try { if (route.value.query?.continueAfterSignIn) {