nuxt-alt / auth

An alternative module to @nuxtjs/auth
https://nuxt-alt-auth.vercel.app/
MIT License
94 stars 20 forks source link

maxAge option does not work #110

Closed Fukao0129 closed 4 months ago

Fukao0129 commented 4 months ago

Environment

@nuxt-alt/auth 2.5.0 node 18.18.2 npm 9.8.1 vue 3.3.8 nuxt 3.8.2

Nuxt Config

auth: {
  strategies: {
    local: {
      scheme: "local",
      endpoints: {
        login: {
          baseURL: process.env.API_URL,
          url: "login",
          method: "post",
        },
        logout: {
          baseURL: process.env.API_URL,
          url: "logout",
          method: "post",
        },
        user: {
          baseURL: process.env.API_URL,
          url: "me",
          method: "get",
        },
      },
      user: {
        property: "data.attributes",
      },
      token: {
        property: "access_token",
        global: true,
        maxAge: 60 * 1,
      },
    },
  },
},

/

Reproduction

I can't provide a reproduction because it occurs in my localhost server.

Describe the bug

I have set the token to expire in one minute by "maxAge" option, but even after more than one minute, it doesn't expire. The token is a JWT token in Bearer format, and Laravel is used in the backend.

Something wrong in my code?

Additional context

No response

Logs

No response

Denoder commented 4 months ago

I don't have the capacity to provide support for the module versions below the current one and I've done a lot of refactoring since then.

Fukao0129 commented 4 months ago

Thank you for your response. I updated the module to the latest version, then other errors have occurred. I'll create a new issue to ask about them. So I close this current one. I appreciate your help!