auth.nuxt.js plugin
This commit is contained in:
@@ -15,7 +15,7 @@ module.exports = {
|
||||
],
|
||||
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
|
||||
},
|
||||
|
||||
|
||||
serverMiddleware: [
|
||||
{ path: '/api', handler: '@/server/api/index.js' }
|
||||
],
|
||||
@@ -50,7 +50,8 @@ module.exports = {
|
||||
*/
|
||||
modules: [
|
||||
// Doc: https://axios.nuxtjs.org/usage
|
||||
'@nuxtjs/axios'
|
||||
'@nuxtjs/axios',
|
||||
'@nuxtjs/auth'
|
||||
],
|
||||
/*
|
||||
** Axios module configuration
|
||||
@@ -61,6 +62,19 @@ module.exports = {
|
||||
// See https://github.com/nuxt-community/axios-module#options
|
||||
},
|
||||
|
||||
auth: {
|
||||
strategies: {
|
||||
local: {
|
||||
endpoints: {
|
||||
login: { url: '/auth/login', method: 'post', propertyName: 'token' },
|
||||
logout: { url: '/auth/logout', method: 'post' },
|
||||
user: { url: '/auth/user', method: 'get', propertyName: 'user' }
|
||||
},
|
||||
// tokenRequired: true,
|
||||
// tokenType: 'bearer',
|
||||
}
|
||||
}
|
||||
},
|
||||
/*
|
||||
** Build configuration
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user