Git Product home page Git Product logo

Comments (4)

Powersource avatar Powersource commented on September 15, 2024 2

I think I might have found the problem! At the above step 3 the token is refreshed and put in storage (localstorage in my case, but I'm guessing that shouldn't matter here). userData from useAuth will still give you the old access token etc., but if you go into the browser debug tools and search in local(/session)storage and search for oidc.user: (it will be followed by a url) you should find a key that contains the new user data and new access token. You can verify this, since if you refresh the page then the access token that useAuth gives you will be the one that you found under oidc.user: and stuff will work again.

from oidc-react.

Powersource avatar Powersource commented on September 15, 2024

I thought (still relatively new to react) it might have been this line

}, [location]);
not containing all its dependencies (according to https://www.npmjs.com/package/eslint-plugin-react-hooks ) but filling it out with the rest didn't help. didn't test it properly it it seems. But the issue ended up being something else anyway, see #363

from oidc-react.

cristian-eriomenco avatar cristian-eriomenco commented on September 15, 2024

I think I might have found the problem! At the above step 3 the token is refreshed and put in storage (localstorage in my case, but I'm guessing that shouldn't matter here). userData from useAuth will still give you the old access token etc., but if you go into the browser debug tools and search in local(/session)storage and search for oidc.user: (it will be followed by a url) you should find a key that contains the new user data and new access token. You can verify this, since if you refresh the page then the access token that useAuth gives you will be the one that you found under oidc.user: and stuff will work again.

Have you found a fix?

from oidc-react.

Powersource avatar Powersource commented on September 15, 2024

Yep in the above PR (but you seem to have found that now :) )

from oidc-react.

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.