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

Replace window pathname by component to fix context-path issues on frontend #1355

Merged
merged 1 commit into from
Feb 6, 2023

Conversation

AlexisSouquiere
Copy link
Collaborator

When using Micronaut context-path, the React router will use this context-path as base path for the frontend.
This leads to issues especially with login (see #907) because, for context-path = /linked, the returnTo will be set to /linked/ui/login/ (the if test doesn't work because of this basename) and will try to redirect the user to /linked/linked/ui/login. Because this path is unknown, user will view the login page twice.

Using the component pathname fixes the issue because we won't take the basename into account to set returnTo and let the React router add it

@tchiotludo
Copy link
Owner

are you sure this syntax this.props.location?.pathname; works on jsx?
Not really sure (really not an expert on jsx)

@AlexisSouquiere
Copy link
Collaborator Author

@tchiotludo
Copy link
Owner

Don't know it was a standard one, thanks for the information and thanks for the pull request

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

Successfully merging this pull request may close these issues.

2 participants