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

Log In trows error "Password was correct, but there was an error logging in." #56

Open
j-salins opened this issue Aug 27, 2023 · 10 comments

Comments

@j-salins
Copy link

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.

@scottyzen
Copy link
Owner

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

@M-GRV
Copy link

M-GRV commented Oct 30, 2023

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?

@colingell
Copy link

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??

@colingell
Copy link

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??

@colingell
Copy link

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

@scottyzen
Copy link
Owner

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.

@bluebird12
Copy link

I have also problems logging in, sometimes it works, most of the time it doesn't.

@ShramkoO
Copy link

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/

Screenshot 2024-05-24 at 21 11 38 Screenshot 2024-05-24 at 21 12 42 Screenshot 2024-05-24 at 21 12 59

@ShramkoO
Copy link

Got it working after:

  1. Used https
  2. 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
  3. 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

@diegomassaroo
Copy link

Is there a way to test it locally without changing the 'SameSite cookie mode' to LAX?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants