1.1.0 • Published 5 years ago

nuxt-auth-refresh v1.1.0

Weekly downloads
17
License
ISC
Repository
github
Last release
5 years ago

An ad hoc module to add authentication refresh to @nuxtjs/auth Build Status

Setup

Register the module before @nuxtjs/auth and @nuxtjs/axios

    // nuxt.config.js
    modules: [
        ['~/modules/refresh-auth'],
        ['@nuxtjs/auth', config.auth],
        ['@nuxtjs/axios', config.axios],
    ]

Options

    {
      // the namespace for our vuex module
      vuexNamespace: 'refreshAuth',
      
      // a key used to store the refresh token
      storageKey: 'my_refresh_token_key',
      
      // the link for login
      loginUrl: '/auth/login',
      
      // token key in login success response and refresh request
      refreshTokenKey: 'refresh_token'
    }