Skip to content

Commit 0ec6787

Browse files
authored
fix(use-custom-fetch-composable): run navigateTo with context (#124)
1 parent d16a590 commit 0ec6787

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: examples/advanced/use-custom-fetch-composable/plugins/customFetch.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default defineNuxtPlugin(() => {
1+
export default defineNuxtPlugin((nuxtApp) => {
22
const userAuth = useCookie('token')
33
const config = useRuntimeConfig()
44

@@ -15,7 +15,7 @@ export default defineNuxtPlugin(() => {
1515
},
1616
onResponseError({ response }) {
1717
if (response.status === 401) {
18-
return navigateTo('/login')
18+
await nuxtApp.runWithContext(() => navigateTo('/login'))
1919
}
2020
},
2121
})

0 commit comments

Comments
 (0)