Skip to content

Commit 4f1d2bc

Browse files
committed
chore: redirect in middleware
1 parent 9491488 commit 4f1d2bc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/nuxt/playground/middleware/vuefire-auth.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
44
console.log('got user in middleware', user?.uid)
55

66
if (!user) {
7-
return navigateTo('/authentication')
7+
return navigateTo({
8+
path: '/authentication',
9+
query: {
10+
redirect: to.fullPath,
11+
},
12+
})
813
}
914
})

0 commit comments

Comments
 (0)