auth
auth copied to clipboard
"No strategy is set!" error
Environment
@nuxt-alt/auth 3.1.4 @nuxt-alt/http 1.7.10 node 18.18.2 npm 9.8.1 vue 3.3.8 nuxt 3.8.2
Nuxt Config
auth: {
strategies: {
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
The 500 error occurs when the localhost server starts to run.
The token is a JWT token in Bearer format, and Laravel is used in the backend.
Additional context
What I tried :
strategies: {
laravelJWT: {
provider: 'laravel/jwt',
url: process.env.API_URL,
}
}
Logs
① nuxt.js?v=134c444b:97 [nuxt] error caught during app initialization Error: No strategy is set!
② auth.plugin.mjs:126 [ERROR] [AUTH] TypeError: Cannot read properties of undefined (reading 'cookie')
③ storage.mjs?v=134c444b:81 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'pinia')