oidc-client-ts
oidc-client-ts copied to clipboard
Why there will trigger multiple refresh token endpoint?.?
Hi, When I change the scope after login with signinRedirect(). like this:
useEffect(()=>{
if(auth.isAuthenticated && !auth.isLoading){
signinRedirect({
redirect_uri: xxx,
scope: scope
})
}
},[auth,scope])
However, after change the scope, there will trigger multiple token endpoint when renew the token.
like this:
Token expired in different times
any idea for this issue? Thanks in advance...!
Logging might give you some insights: https://authts.github.io/oidc-client-ts/#md:logging
Maybe (React StrictMode](https://react.dev/reference/react/StrictMode) is tricking you?
Thanks for reply. It works as expected when React StrictMode disabled But it will trigger multiple refresh token endpoint when React StrictMode enable, is there any way to fix it..?
Thanks for reply. It works as expected when React StrictMode disabled But it will trigger multiple refresh token endpoint when React StrictMode enable, is there any way to fix it..?
This is only a problem for development/debug, you can handle it like proposed by the React markers: https://github.com/facebook/react/issues/24502#issuecomment-1118867879
hi @wingosite,
React 18 renders twice in development mode, u can remove StrictMode in your index,js or index.ts
root.render(
<>
<Provider store={store}>
<CustomThemeProvider>
<CssBaseline />
</CustomThemeProvider>
</Provider>
</>
);
I have one question; I am not able to implement proper redirection. My application is redirecting infinitely. Can you show an example?