Migration Guide
Last updated
Last updated
The best reference to upgrade or getting started are and .
You have to move auth.endpoints
into auth.strategies.local.endpoints
:
For choosing login strategy a new method $auth.loginWith(provider[,options])
is available.
The $auth.user
and $auth.loggedIn
reactive properties are the recommended way to access user info.
For low-level state you can use $auth.$storage
.
Token can be retrieved using $auth.getToken(provider)
.
If you have any plugin that needs extending $auth
you have to pass it into auth.plugins[]
option instead of top level plugins[]
inside nuxt.config.js
.
Please refer to the new docs.
4.x is a new rewrite of Auth module. This release introduces some new features but also includes breaking changes with both usage and options, this guide will allow you to easily upgrade from 3.x to 4.x
The module now watches any changes from loggedIn
and automatically redirects users on login and logout.
NOTE : User will be redirected using login
and home
from redirect
options
Any store actions should be replaced with new global $auth
instance. The best reference is official Docs for new usage.
If you were using promise acceptance to redirect users after login and logout like this:
Now you can do this:
auth
middleware now manages both authenticated and unauthenticated user redirection
no-auth
middleware have been removed and merged into auth
middleware
If you were using the following configuration in 3.x :
This is the corresponding configuration in 4.x :
If you were using the following configuration in 3.x :
This is the corresponding configuration in 4.x :
If you were using the following configuration in 3.x :
This is the corresponding configuration in 4.x :