Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options not working in cookie strategy #1854

Open
sadeghi-aa opened this issue Oct 1, 2023 · 0 comments
Open

Options not working in cookie strategy #1854

sadeghi-aa opened this issue Oct 1, 2023 · 0 comments
Labels

Comments

@sadeghi-aa
Copy link

Hi. This is my auth module configuration in my NuxtJS 2, SSR project. The issue is that none of the options I've set in the options are actually being set; that is, the cookie is created with Expires attribute having the value of Session and so it results in the first page load being redirected to the login page. I also want other attributes like secure and httpOnly for security. Am I doing something wrong?

  auth: {
    redirect: {
      login: '/login,
      logout: '/',
      home: '/',
      callback: false,
    },
    rewriteRedirects: true,
    resetOnError: false,
    fullPathRedirect: true,
    strategies: {
      local: false,
      cookie: {
        token: {
          property: 'data.token',
          required: true,
        },
        options: {
          expires: 7,
          path: '*',
          httpOnly: true,
          secure: true,
        },
        endpoints: {
          login: { url: '/login/', method: 'post' },
          logout: { url: '/logout/', method: 'post' },
          user: false,
        },
        user: {
          property: false,
          autoFetch: true,
        },
      },
    },
    plugins: [
      '~/plugins/auth.js',
      '~/plugins/axios',
    ],
  },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant