Skip to content

Instantly share code, notes, and snippets.

@MrNaif2018
Created December 7, 2019 20:05
Show Gist options
  • Save MrNaif2018/c9ff421f7af1f18c0e0a4a13d8aa3e7f to your computer and use it in GitHub Desktop.
Save MrNaif2018/c9ff421f7af1f18c0e0a4a13d8aa3e7f to your computer and use it in GitHub Desktop.
@nuxtjs/auth configuration for refresh tokens and cookies
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