Coder Social home page Coder Social logo

Comments (3)

dbarrosop avatar dbarrosop commented on June 12, 2024

Thanks for the report. That request should make no call to the /token endpoint though, so there must be something else going on. Would you mind providing a sample repository triggering the issue?

You can also take a look at our comprehensive react example which doesn't seem to trigger this issue:

code: https://github.com/nhost/nhost/tree/main/examples/react-apollo
website: https://react-apollo.example.nhost.io/sign-in

from nhost.

Denis-NV avatar Denis-NV commented on June 12, 2024

Thanks for your reply @dbarrosop. I tried to strip down my code to bare bones to isolate the issue and I think I found the cause of the problem. I was running my code locally in dev mode and I was already logged in as one of the users of my app. So, commenting out pretty much all the code from the root of my app and refreshing the browser page still produced the same error, as my user remained logged in. This made me thinking that it's got to be something to do with NhostClient trying to make those calls to https://[my-domain].auth.eu-west-2.nhost.run/v1/token endpoint under the hood. Fair enough, setting autoSignIn: false on the NhostClient constructor fixed the issue. Bare in mind that when I uncommented my log in / log out flow, I can still log in, refresh the page and my user remains logged in.

I wonder if the bug was introduced in the version of the "@nhost/react": "^3.4.2" that I'm using. In the example you provided (https://github.com/nhost/nhost/tree/main/examples/react-apollo) @nhost/react dependency gets imported locally from the mono-repo. So I don't really know what version it is.

P.S. The example you provided still uses the react-apollo dependency (https://github.com/nhost/react-apollo), which is deprecated on Feb 16, 2022 in favour of @nhost/apollo, however the new package usage is not documented and there are no examples of utilising it. I had to look into its source code to understand how to use it. It would be great if you could cover that gap. Otherwise thank for the work you're doing.

from nhost.

dbarrosop avatar dbarrosop commented on June 12, 2024

So I don't really know what version it is.

It uses the latest one as it is rebuilt on every release.

The example you provided still uses the react-apollo

The example I provided uses @nhost/react-apollo from the same repo.

however the new package usage is not documented and there are no examples of utilising it.

As mentioned above, the example above, the reference documentation and our quickstart are all using that library.

from nhost.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.