Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect to another route is not happening #221

Open
pbollaram opened this issue Aug 2, 2021 · 5 comments
Open

Redirect to another route is not happening #221

pbollaram opened this issue Aug 2, 2021 · 5 comments

Comments

@pbollaram
Copy link

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.

@arvindkrishnakumar-okta
Copy link

Thanks for the post!

@oleksandrpravosudko-okta can you help with this?

@oleksandrpravosudko-okta
Copy link
Contributor

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?

@pbollaram
Copy link
Author

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"

@oleksandrpravosudko-okta
Copy link
Contributor

Do you happen to have history@5.x installed? There seem to be reports of router not working properly with v5.

@pbollaram
Copy link
Author

pbollaram commented Aug 6, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants