Skip to content

Commit ef192c9

Browse files
authored
docs(ru): Translation update (#3136)
* docs: [RU] Translation update * README.md обновление * navigation.md fix * consistent code blocks * dynamic-matching.md add new section * dynamic-matching.md fix * navigation-guards.md fix title * data-fetching.md fix * README.md fix * (docs) [RU] Translation update * fix typo * navigation-guards.md update * redirect-and-alias.md update * change '$route' to $route * date-fetching.md formatting * histort-mode.md update * navigation-guards.md update * navigation-guards.md update * navigation-guards.md fix example
1 parent 39d46b2 commit ef192c9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: docs/ru/guide/advanced/navigation-guards.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ router.beforeEach((to, from, next) => {
3939
```js
4040
// ПЛОХО
4141
router.beforeEach((to, from, next) => {
42-
if (!isAuthenticated) next('/login')
42+
if (to.name !== 'Login' && !isAuthenticated) next({ name: 'Login' })
4343
// если пользователь не авторизован, то `next` будет вызываться дважды
4444
next()
4545
})
@@ -48,7 +48,7 @@ router.beforeEach((to, from, next) => {
4848
```js
4949
// ХОРОШО
5050
router.beforeEach((to, from, next) => {
51-
if (!isAuthenticated) next('/login')
51+
if (to.name !== 'Login' && !isAuthenticated) next({ name: 'Login' })
5252
else next()
5353
})
5454
```

0 commit comments

Comments
 (0)