Skip to content

Commit

Permalink
feat: add refresh provider
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Dec 14, 2023
1 parent a97a4d3 commit d7ad8b3
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,18 @@ export default defineNuxtConfig({

/** @type {import('@sidebase/nuxt-auth')} */
auth: {
// TODO: Refresh token

baseURL: process.env.API_URL + '/auth',

provider: {
type: 'local',
type: 'refresh',

endpoints: {
signIn: { path: '/log-in', method: 'post' },
signOut: null,
signUp: null,
signOut: null,

getSession: { path: '/profile', method: 'get' }
getSession: { path: '/profile', method: 'get' },
refresh: { path: '/refresh', method: 'post'}
},

pages: {
Expand All @@ -124,9 +123,15 @@ export default defineNuxtConfig({

type: 'Bearer',

maxAgeInSeconds: 1800 // 30 minutes
maxAgeInSeconds: 60 * 30 // 30 minutes
},

refreshToken: {
signInResponseRefreshTokenPointer: '/refresh_token',

maxAgeInSeconds: 60 * 60 * 24 * 30 // 30 days
},

sessionDataType: {
email: 'string',

Expand Down

0 comments on commit d7ad8b3

Please sign in to comment.