mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 21:55:11 +00:00
docs: add missing return
statement
This commit is contained in:
parent
4430c664e8
commit
fc7867fb0e
@ -49,7 +49,7 @@ export default defineNuxtRouteMiddleware((to, from) => {
|
|||||||
const auth = useState('auth')
|
const auth = useState('auth')
|
||||||
|
|
||||||
if (!user.value.isAuthorized) {
|
if (!user.value.isAuthorized) {
|
||||||
abortNavigation('Insufficient permissions.')
|
return abortNavigation('Insufficient permissions.')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
@ -63,7 +63,7 @@ export default defineNuxtRouteMiddleware((to, from) => {
|
|||||||
try {
|
try {
|
||||||
/* code that might throw an error */
|
/* code that might throw an error */
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
abortNavigation(err)
|
return abortNavigation(err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user