From b99d496ce08413749021dd8fc1e99b4d81da507d Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Fri, 29 Jul 2022 22:03:30 +0200 Subject: [PATCH] chore(gui-v2): cleanup --- packages/nc-gui-v2/composables/useGlobal/actions.ts | 1 - packages/nc-gui-v2/composables/useGlobal/state.ts | 4 +--- packages/nc-gui-v2/middleware/auth.global.ts | 1 - 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/nc-gui-v2/composables/useGlobal/actions.ts b/packages/nc-gui-v2/composables/useGlobal/actions.ts index 46d2eea964..108f6e1428 100644 --- a/packages/nc-gui-v2/composables/useGlobal/actions.ts +++ b/packages/nc-gui-v2/composables/useGlobal/actions.ts @@ -5,7 +5,6 @@ import { useNuxtApp } from '#imports' export function useGlobalActions(state: State) { const { $api } = useNuxtApp() - /** Actions */ /** Sign out by deleting the token from localStorage */ const signOut: Actions['signOut'] = () => { state.token.value = null diff --git a/packages/nc-gui-v2/composables/useGlobal/state.ts b/packages/nc-gui-v2/composables/useGlobal/state.ts index 18ebfde3a8..92780a0325 100644 --- a/packages/nc-gui-v2/composables/useGlobal/state.ts +++ b/packages/nc-gui-v2/composables/useGlobal/state.ts @@ -5,9 +5,7 @@ import type { State, StoredState } from './types' import { computed, ref, toRefs, useNuxtApp, useTimestamp } from '#imports' import type { User } from '~/lib' -const storageKey = 'nocodb-gui-v2' - -export function useGlobalState(): State { +export function useGlobalState(storageKey = 'nocodb-gui-v2'): State { /** get the preferred languages of a user, according to browser settings */ const preferredLanguages = $(usePreferredLanguages()) /** todo: reimplement; get the preferred dark mode setting, according to browser settings */ diff --git a/packages/nc-gui-v2/middleware/auth.global.ts b/packages/nc-gui-v2/middleware/auth.global.ts index 2100fce285..06e6b822c1 100644 --- a/packages/nc-gui-v2/middleware/auth.global.ts +++ b/packages/nc-gui-v2/middleware/auth.global.ts @@ -25,7 +25,6 @@ export default defineNuxtRouteMiddleware((to, from) => { /** if auth is required or unspecified (same as required) and user is not signed in, redirect to signin page */ if ((to.meta.requiresAuth || typeof to.meta.requiresAuth === 'undefined') && !state.signedIn.value) { - console.log('tosignin') return navigateTo('/signin') } else if (to.meta.requiresAuth === false && state.signedIn.value) { /**