Created
December 7, 2019 20:05
-
-
Save MrNaif2018/c9ff421f7af1f18c0e0a4a13d8aa3e7f to your computer and use it in GitHub Desktop.
@nuxtjs/auth configuration for refresh tokens and cookies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
axios: { | |
baseURL: 'http://localhost:8000' | |
}, | |
router: { | |
middleware: ['loggedIn'] | |
}, | |
auth: { | |
localStorage: false, | |
cookie: { | |
options: { | |
expires: 7 | |
} | |
}, | |
strategies: { | |
local: { | |
endpoints: { | |
login: { url: '/token', method: 'post', propertyName: false }, | |
logout: false, | |
user: { url: '/users/me', method: 'get', propertyName: false } | |
} | |
} | |
}, | |
plugins: ['~/plugins/axios.js', { src: '~/plugins/auth.js', mode: 'client' }] | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment