Comments (4)
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.
I thought (still relatively new to react) it might have been this line
oidc-react/src/AuthContext.tsx
Line 105 in 71d86cf
from oidc-react.
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 underoidc.user:
and stuff will work again.
Have you found a fix?
from oidc-react.
Yep in the above PR (but you seem to have found that now :) )
from oidc-react.
Related Issues (20)
- Double access-control-allow-origin header HOT 2
- CORS HOT 4
- How to manually invalidate user data cache?
- Avoiding "No authority or metadataUrl configured" when authentication isn't needed?
- Error Handling for failed authentication
- Uncaught (in promise) Error: No matching state found in storage at OidcClient.readSigninResponseState (oidc-client-ts.js:1785:1) at async UserManager.signinCallback HOT 5
- Question: Why return value of onBeforeSignIn is limited to string? HOT 3
- NPM Registry README is empty
- Action Required: Fix Renovate Configuration
- I can't exactly logout HOT 1
- Acquire access token with a new scope
- I had redirect to the login page and after i login it, it shows userData null so i can't get the user's data. Can someone help me?
- Possible interference with AuthProvider and react-router route loader
- PR CodeCov comparison reports are broken
- Authority must be hard-coded HOT 1
- Redirect to original url HOT 1
- Login not handled properly when `userdata.expired` and `autoSignIn: false`. HOT 2
- Add compatibility with Ionic React HOT 3
- When initially mounted, isLoading is never set to false
- Source Maps produce build errors HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oidc-react.