1

I am using Nuxt-auth local strategy, I set the cookie in nuxt.config.js to false because my token is too large for cookie, but when I do that when refreshing the page it redirects me to login page. Here is my auth configuration.

auth: {
    cookie: false,
    localStorage: {
        prefix: "auth.",
    },
    redirect: {
        login: "/auth/signin",
        logout: "/auth/signin",
        callback: "/auth/signin",
        home: false,
    },
    strategies: {
        local: {
            token: {
                property: "token",
                global: true,
                required: true,
                type: "Bearer",
            },
            user: {
                property: "data",
                autoFetch: true,
            },
            endpoints: {
                login: { url: "/login", method: "post" },
                logout: { url: "/logout", method: "post" },
                user: { url: "/auth/user", method: "get" },
            },
        },
    },
},

any solutions?

Abdullah Qasemi
  • 449
  • 1
  • 12

0 Answers0