Comments (4)
Hi, thank you for reporting this.
I see that the behaviour on this is not well documented. Will get that fixed.
But you can already control this if you provide a callback function to the onRefreshTokenExpire
configuration parameter.
So the logic is:
If the 'refreshToken' expires, or a silent refresh fails, call the 'onRefreshTokenExpire`-calback, if that is undefined, redirect to login.
You'd usually do something like this;
onRefreshTokenExpire: (event) =>
window.confirm('Session expired. Refresh page to continue using the site?') && event.login()
A hot tip is that you can manually change values in localStorage to trigger some events for testing. The package listens for changes to localstorage and updates it's state when it changes.
from react-oauth2-pkce.
Hi 👋🏽
Will this workaround still work even if I'm not using refresh token?
from react-oauth2-pkce.
Yes, if there is no refresh_token
, this event will happen when the access_token
expires.
from react-oauth2-pkce.
I assume the suggestion solution worked for you @rferreira98
closing the issue
from react-oauth2-pkce.
Related Issues (20)
- Bug: When developing with <React.StrictMode> in React 18, will get an error because the same auth code is used twice HOT 3
- Bug: Cannot logout of the auth provider HOT 8
- The document mentions : HOT 1
- Bug: redirect uri and Logout HOT 3
- AutoLogin Needs fixing HOT 2
- feature: implement `state` in code request HOT 1
- Bug: Opening the application multiple times will lead to `onRefreshTokenExpire` in all but one instance HOT 9
- Bug: session not ended if browser was closed HOT 2
- 💡 [REQUEST] - Optionally store state in sessionStorage
- 💡 [REQUEST] - Implement a check on function availability
- 💡 [REQUEST] - Enable separate decoding steps for token/id_token HOT 1
- Bug: Session ends within 10 minutes with React 17. HOT 4
- Bug: Unable to set value "false" in `setStorage` hook
- Session storage does not work when user is redirected back to the application after resetting password. HOT 11
- Unable to redirect to logout page without a refresh token HOT 3
- Bug: Bad authorization state. Refreshing the page might solve the issue. ( HOT 5
- 💡 [REQUEST] - Next.js support out of the box HOT 4
- Bug: Auto login triggered when fetching tokens HOT 1
- Bug: Infinite loop using Microsoft Provider HOT 3
- 💡 [REQUEST] - Allow send cookies on the method postWithXForm HOT 2
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 react-oauth2-pkce.