diff --git a/packages/nc-gui/composables/useApi/interceptors.ts b/packages/nc-gui/composables/useApi/interceptors.ts index b4e9914a52..0fde440f8a 100644 --- a/packages/nc-gui/composables/useApi/interceptors.ts +++ b/packages/nc-gui/composables/useApi/interceptors.ts @@ -67,6 +67,14 @@ export function addAxiosInterceptors(api: Api) { skipLogout: true, }) + if (!token) { + await state.signOut({ + redirectToSignin: !isSharedPage, + skipApiCall: true, + }) + return Promise.reject(error) + } + const config = error.config config.headers['xc-auth'] = token diff --git a/packages/nc-gui/composables/useGlobal/types.ts b/packages/nc-gui/composables/useGlobal/types.ts index 1ad3975705..8696bd0475 100644 --- a/packages/nc-gui/composables/useGlobal/types.ts +++ b/packages/nc-gui/composables/useGlobal/types.ts @@ -92,7 +92,11 @@ export interface SignOutParams { export interface Actions { signOut: (signOutParams?: SignOutParams) => Promise signIn: (token: string, keepProps?: boolean) => void - refreshToken: (params: { axiosInstance?: AxiosInstance; skipLogout?: boolean; cognitoOnly?: boolean }) => Promise + refreshToken: (params: { + axiosInstance?: AxiosInstance + skipLogout?: boolean + cognitoOnly?: boolean + }) => Promise loadAppInfo: () => void setIsMobileMode: (isMobileMode: boolean) => void navigateToProject: (params: { workspaceId?: string; baseId?: string; type?: NcProjectType; query?: any }) => void diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts index 53368059b2..f77572d6d5 100644 --- a/packages/nocodb-sdk/src/lib/Api.ts +++ b/packages/nocodb-sdk/src/lib/Api.ts @@ -2846,6 +2846,8 @@ export interface ViewType { | MapType | CalendarType | (FormType & GalleryType & GridType & KanbanType & MapType & CalendarType); + /** ID of view owner user */ + owned_by?: IdType; } /** @@ -2918,6 +2920,8 @@ export interface ViewUpdateReqType { order?: number; /** Should this view show system fields? */ show_system_fields?: BoolType; + /** ID of view owner user */ + owned_by?: IdType; } /**