woonuxt
woonuxt copied to clipboard
Log In trows error "Password was correct, but there was an error logging in."
refreshCart() method returns results from graphql query GqlGetCart where customer object fields are empty and viewer object is null.
Could this be because of incorrect graphql plugin configuration or something else?
When registering new user from nuxt app, it saves data on backend, but throws same error in nuxt.
Hi @j-salins. Can you send me your front-end URL and I'll have a look to see what's going on? It sounds like it could be a cors issue. Check and make sure the WPGraphQL CORS plugin is set up correctly
refreshCart() method returns results from graphql query GqlGetCart where customer object fields are empty and viewer object is null.
Could this be because of incorrect graphql plugin configuration or something else?
When registering new user from nuxt app, it saves data on backend, but throws same error in nuxt.
Are you still seeing this concern or can the issue be closed?
I've come across this but if I set
const viewer = useState('viewer', ()=> 'myusername');
in useAuth.ts
It allows the login, to me it seems like the const updateViewer doesn't get called to update viewer.value with the payload.
I'm not too sure if any of this helps??
adding
viewer.value = {databaseId: 0, id: '', username: credentials.username};
in the const loginUser
seems to be a workaround, but I still need 'viewer' to update properly??
seems I can't disable cors for use in localhost :/ https://www.reddit.com/r/Nuxt/comments/10ypi1y/headless_wp_authentication_with_nuxt_3/
'WP GraphQL CORS extension' comes with loginWithCookies
Hey guys.
If ye PM me the WPGraphQL endpoint that ye are having issue's with I can take a look. Sound's like the backend might me missing a few settings.
I have also problems logging in, sometimes it works, most of the time it doesn't.
Hello! @scottyzen . It looks like the nuxt app, the client somehow doesn't attach cookies that are asked to set by server.
You can try it here https://graceful-gaufre-d45d6e.netlify.app/
Got it working after:
- Used https
- Used same domain name for wordpress site and for nuxt app. So nuxt app is on mydomain.com and wordpress is on wp.mydomain.com
- Set "Samesite cookie mode" to LAX on the WPGraphQL CORS settings page
Now cookies were sent well and logged in successfully and viever is not empty in the response from the wp
Is there a way to test it locally without changing the 'SameSite cookie mode' to LAX?