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

auth.login issue with nuxt module #610

Open
rmaxxx opened this issue Jul 4, 2021 · 6 comments
Open

auth.login issue with nuxt module #610

rmaxxx opened this issue Jul 4, 2021 · 6 comments

Comments

@rmaxxx
Copy link

rmaxxx commented Jul 4, 2021

Hello,

Trying nuxt module with hbp (standalone from source), and i get an error when calling auth.login :

await this.$nhost.auth.login({
  email: this.login,
  password: this.password
});

I get a validation error:

{data: "Error validating request body. \"value\" does not match any of the allowed types.", status: 400, statusText: "", headers: {…}, config: {…}, …}

If i check in dev tools, "cookie": false is added to the request payload.

Tested the endpoint with postman and it works fine, but if i add "cookie": false to the payload, i get the same body validation error...

Thanks.

@rmaxxx rmaxxx closed this as completed Jul 4, 2021
@rmaxxx
Copy link
Author

rmaxxx commented Jul 4, 2021

Fixed sorry!

@elitan
Copy link
Contributor

elitan commented Jul 4, 2021

Fixed sorry!

What was the fix?

It might be helpful for other users with the same problem to learn what was wrong and how you fixed it.

@plmercereau
Copy link
Contributor

Same problem here. I think nhost-js-sdk is out of sync with the latest HBP version, as it sends this cookie: false/true while payload validation does not expect it (see @utils/validation).
Reopenning

@plmercereau plmercereau reopened this Jul 5, 2021
@migsar
Copy link

migsar commented Jul 10, 2021

I came here looking for a different question (Why with Insomnia HTTP client I received cookies but with nhost-js-sdk I didn't?) but this point me in the right direction... the library has the default for cookies set to false.

I think the problem is not being clear on docs about which the latest version is, don't get me wrong, I know it is hard... I am using v2.5.2 because @elitan suggested me to do that way in a previous issue I opened. Here: 3b32d4b we can see cookie param was introduced on v2.2.0 and it is still present on the latest release.

Still it doesn't seem to be present on master, which is v2.3.0 according to package.json.

@migsar
Copy link

migsar commented Jul 10, 2021

Related nhost/nhost-js-sdk#49

@elitan
Copy link
Contributor

elitan commented Jul 14, 2021

I came here looking for a different question (Why with Insomnia HTTP client I received cookies but with nhost-js-sdk I didn't?) but this point me in the right direction... the library has the default for cookies set to false.

I think the problem is not being clear on docs about which the latest version is, don't get me wrong, I know it is hard... I am using v2.5.2 because @elitan suggested me to do that way in a previous issue I opened. Here: 3b32d4b we can see cookie param was introduced on v2.2.0 and it is still present on the latest release.

Still it doesn't seem to be present on master, which is v2.3.0 according to package.json.

Versions and master have been a bit out of sync. It should be fixed in the coming days. I'll update this thread once we've released a new version of HBP with the latest changes.

Generally, these issues seem related to nhost-js-sdk. I'll come back to this later.

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

4 participants