You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/nuxt/auth.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,6 +54,24 @@ definePageMeta({
54
54
</script>
55
55
```
56
56
57
+
::: warning
58
+
59
+
If you are using a [global middleware](https://nuxt.com/docs/getting-started/routing#route-middleware), make sure **you are not getting into a redirect loop** by ensuring `navigateTo()` is only called if the target location is not the same page:
You can even automatically handle the auth state by _watching_ the current user. We recommend you do this in either a layout or the `app.vue` component so the watcher is always active:
0 commit comments