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/global-guard.md
+5-7Lines changed: 5 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
As the name implies, the navigation guards provided by vue-router are primarily used to guard navigations either by redirecting it or canceling it. There are a number of ways to hook into the route navigation process: globally, per-route, or in-component.
3
3
4
4
!!! warning
5
-
Remember that params or query changes won't trigger enter/leave navigation guards. You can either watch the $route object to react to those changes, or use the beforeRouteUpdate in-component guard, see [vue-router global navigation guards](https://router.vuejs.org/en/advanced/navigation-guards.html).
5
+
Remember that params or query changes won't trigger enter/leave navigation guards. You can either watch the $route object to react to those changes or use the beforeRouteUpdate in-component guard, see [vue-router global navigation guards](https://router.vuejs.org/en/advanced/navigation-guards.html).
6
6
7
7
### Myfirebase global navigation guards.
8
8
@@ -16,7 +16,7 @@ Typically, The middleware generated might look something like this:
16
16
/**
17
17
* MiddlewareNmae, you can get access
18
18
* to myfirebase functionalities and vue auth guard via actions.
19
-
* myfirebase => [auth, storage, store]
19
+
* myfirebase => [auth, storage, store, firestore]
20
20
* actions => [to, from, next()]
21
21
*
22
22
* @param{object}myfirebase
@@ -56,7 +56,7 @@ export default middlewares
56
56
57
57
#### Auth Middleware
58
58
59
-
Myfirebase comes with an exmaple of auth middleware called AuthMiddleware located in middlewares directory, this will check if the user is signed-in or not, and redirecting users to the login page.
59
+
Myfirebase comes with an example called AuthMiddleware located in middlewares directory, this will check if the user is signed-in or not, and be redirecting users to the login page.
60
60
61
61
As you may notice, you will find in the **route.js** file a **metadata** called auth, which is assigned to **App** and **UpdateProfile** components.
62
62
@@ -67,7 +67,7 @@ As you may notice, you will find in the **route.js** file a **metadata** called
67
67
/**
68
68
* AuthMiddleware, you can get access
69
69
* to myfirebase functionalities and vue auth guard via actions.
70
-
* myfirebase => [auth, storage, store]
70
+
* myfirebase => [auth, storage, store, firestore]
71
71
* actions => [to, from, next()]
72
72
*
73
73
* @param{object}myfirebase
@@ -134,6 +134,4 @@ const routes = [{
134
134
components: NotFound
135
135
}
136
136
]
137
-
```
138
-
139
-
These guards have the exact same signature as global before guards.
0 commit comments