diff --git a/components/Conversation.vue b/components/Conversation.vue index 81c8043..e8f050e 100644 --- a/components/Conversation.vue +++ b/components/Conversation.vue @@ -2,7 +2,7 @@ import {EventStreamContentType, fetchEventSource} from '@microsoft/fetch-event-source' import {addConversation} from "../utils/helper"; -const { $i18n, $auth } = useNuxtApp() +const { $i18n } = useNuxtApp() const runtimeConfig = useRuntimeConfig() const currentModel = useCurrentModel() const openaiApiKey = useApiKey() diff --git a/composables/useAuthFetch.js b/composables/useAuthFetch.js index 72e7d40..a1acd12 100644 --- a/composables/useAuthFetch.js +++ b/composables/useAuthFetch.js @@ -1,9 +1,8 @@ -export const useAuthFetch = async (url, options = {}) => { - const { $auth } = useNuxtApp() +export const useAuthFetch = async (url, options = {}) => { const res = await useFetch(url, options) if (res.error.value && res.error.value.status === 401) { - await $auth.logout() + await logout() } return res } diff --git a/layouts/default.vue b/layouts/default.vue index 22b6f0e..e56ff2e 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -1,7 +1,7 @@