-
Notifications
You must be signed in to change notification settings - Fork 912
Migration Guide
Tony Briet edited this page Jan 30, 2018
·
5 revisions
4.x release introduce some new features but also includes breaking changes, this guide will allow you to easily upgrade from 3.x to 4.x
-
authmiddleware now manages both authenticated and unauthenticated user redirection -
no-authmiddleware have been removed and merged intoauthmiddleware - In order to manage
authmiddleware redirection behaviour, new options have been added toredirectconfiguration:- guest (Boolean) - Enable or disable unauthenticated middleware redirection. (default: true)
- user (Boolean) - Enable or disable authenticated middleware redirection. (default: true)
If you were using the following configuration in 3.x :
// nuxt.config.js
router: {
middleware: [
'auth',
'no-auth'
]
}This is the corresponding configuration in 4.x :
// nuxt.config.js
router: {
middleware: [
'auth',
]
}If you were using the following configuration in 3.x :
// nuxt.config.js
router: {
middleware: [
'auth',
]
}This is the corresponding configuration in 4.x :
// nuxt.config.js
auth: {
redirect: {
user: false
}
},
router: {
middleware: [
'auth',
]
}If you were using the following configuration in 3.x :
router: {
middleware: [
'no-auth',
]
}This is the corresponding configuration in 4.x :
// nuxt.config.js
auth: {
redirect: {
guest: false
}
},
router: {
middleware: [
'auth',
]
}