samples-js-react icon indicating copy to clipboard operation
samples-js-react copied to clipboard

Redirect to another route is not happening

Open pbollaram opened this issue 4 years ago • 5 comments

Hi,

Followed same as mentioned in example but i need to redirect my app to different route on successful sign in. So as mentioned in documentation i am doing this below const login = async () => { oktaAuth.signInWithRedirect({ originalUri: '/dashboard' }); };

but my dashboard component is not loaded. I see that the URL on the browser is getting changed but react component is not loaded. Maybe the router is not detecting the change from oktaAuth

I have the following route specified in my app.

pbollaram avatar Aug 02 '21 21:08 pbollaram

Thanks for the post!

@oleksandrpravosudko-okta can you help with this?

arvindkrishnakumar-okta avatar Aug 03 '21 03:08 arvindkrishnakumar-okta

Hi @pbollaram,

Does /dashboard-bound component load during 'regular' navigation? (i.e. navigating by link or browsing directly onto it) Would you mind providing details of your router configuration?

yes about /dashboard. I was able to load it if iIrefresh the page with /dashboard URL or when clicked on route

"react-router-dom": "^5.2.0"

pbollaram avatar Aug 05 '21 16:08 pbollaram

Do you happen to have [email protected] installed? There seem to be reports of router not working properly with v5.

No, I am not using that. I have followed another example that you have mentioned(custom-login example). That is letting me sign in and redirection is also happening, but strangely renew token is not working with that.

pbollaram avatar Aug 06 '21 17:08 pbollaram