Skip to content

Commit

Permalink
feat: add refresh jwt auth
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Feb 23, 2021
1 parent 2e5902f commit 498d3cd
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,19 @@ export default {
auth: {
strategies: {
local: {
scheme: 'refresh',

token: {
type: 'Bearer',
property: 'access_token',
required: true,
type: 'Bearer',
maxAge: 1800, // 30 minutes
},

refreshToken: {
property: 'refresh_token',
required: true,
maxAge: 60 * 60 * 24 * 15, // 15 days
},

user: {
Expand All @@ -106,7 +115,11 @@ export default {
},

endpoints: {
login: { url: `${process.env.API_URL}/auth/login`, method: 'post' },
login: { url: `${process.env.API_URL}/auth/log-in`, method: 'post' },
refresh: {
url: `${process.env.API_URL}/auth/refresh`,
method: 'post',
},
logout: false,
user: { url: `${process.env.API_URL}/auth/profile`, method: 'get' },
},
Expand All @@ -115,12 +128,12 @@ export default {

redirect: {
login: '/premium',
logout: false,
logout: '/premium',
callback: false,
home: false,
},

watchLoggedIn: false,
watchLoggedIn: true,

vuex: { namespace: 'authentication' },
},
Expand Down

0 comments on commit 498d3cd

Please sign in to comment.