Browse Source

refactor(nc-gui): remove user from local storage

pull/3701/head
braks 2 years ago
parent
commit
255d90686d
  1. 5
      packages/nc-gui/composables/useGlobal/state.ts
  2. 2
      packages/nc-gui/composables/useGlobal/types.ts

5
packages/nc-gui/composables/useGlobal/state.ts

@ -49,7 +49,6 @@ export function useGlobalState(storageKey = 'nocodb-gui-v2'): State {
/** State */
const initialState: StoredState = {
token: null,
user: null,
lang: preferredLanguage,
darkMode: prefersDarkMode,
feedbackForm: {
@ -102,6 +101,9 @@ export function useGlobalState(storageKey = 'nocodb-gui-v2'): State {
/** global error */
const error = ref()
/** our local user object */
const user = ref<User | null>(null)
return {
...toRefs(storage.value),
storage,
@ -110,6 +112,7 @@ export function useGlobalState(storageKey = 'nocodb-gui-v2'): State {
timestamp,
runningRequests,
error,
user,
appInfo,
}
}

2
packages/nc-gui/composables/useGlobal/types.ts

@ -29,7 +29,6 @@ export interface AppInfo {
export interface StoredState {
token: string | null
user: User | null
lang: keyof typeof Language
darkMode: boolean
feedbackForm: FeedbackForm
@ -43,6 +42,7 @@ export interface StoredState {
export type State = ToRefs<Omit<StoredState, 'token'>> & {
storage: Ref<StoredState>
user: Ref<User | null>
token: WritableComputedRef<StoredState['token']>
jwtPayload: ComputedRef<(JwtPayload & User) | null>
timestamp: Ref<number>

Loading…
Cancel
Save