Closed wonder95 closed 3 years ago
Hi. You also need to configure user
endpoint. After page reloads nuxt needs to fetch user from API.
Same problem. Deleting .nuxt folder does not help.
local: {
endpoints: {
login: {propertyName: false},
user: false,
logout: false
}
}
But got old value in plugins.js
inside .nuxt
folder:
// local
$auth.registerStrategy('local', new scheme_3e2123be($auth, {
"endpoints": {
"login": {
"url": "/api/auth/login", // <----- HERE is old value
"method": "post",
"propertyName": false
}, "logout": false, "user": false
}, "_name": "local"
}))
But got old value in
plugins.js
inside.nuxt
folder:// local $auth.registerStrategy('local', new scheme_3e2123be($auth, { "endpoints": { "login": { "url": "/api/auth/login", // <----- HERE is old value "method": "post", "propertyName": false }, "logout": false, "user": false }, "_name": "local" }))
@steklopod
/api/auth/login
is the default value as you can see here https://github.com/nuxt-community/auth-module/blob/dev/lib/module/defaults.js
So that is not an "old" value, just the value you get because you're not setting the property to another value.
change
login: {propertyName: false},
to
login: { propertyName: false, url: '/something/else' },
and you will see the difference.
Same issue for me.
Whatever I set url to is ignored and goes to default.
I've tried renaming the strategy to something other than local and just get a different error now.
I have an old project that uses the same config that works (just a different baseURL for axios).
I've just updated the defaults in the module for now to get it working but not ideal.
Fixed the problem!
My nuxt.config file had 2 auth objects. One that I had filled in correctly, and a second that was blank..
Just deleted the blank one and all works as expected.
:-/
Version
v4.5.1
Reproduction link
http://no-link-sorry
Steps to reproduce
1) Install module 2) Configure
nuxt.config.js
to use `auth/login/' as login URL:The only place that I can find where this URL is set anywhere is in .nuxt/auth/plugin.js:
What is expected ?
Configured login URL is called
What is actually happening?
Hardcoded usl 'auth/user` is called, resulting in 404 error
Additional comments?
I am using v 4.5.3, but form select list does not allow any value higher than 4.5.1