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

Use history mode in Vue Router for better redirects after login for deep links #876

Closed
asibross opened this issue Aug 8, 2018 · 4 comments · Fixed by #1127
Closed

Use history mode in Vue Router for better redirects after login for deep links #876

asibross opened this issue Aug 8, 2018 · 4 comments · Fixed by #1127

Comments

@asibross
Copy link
Contributor

asibross commented Aug 8, 2018

I am using Spring boot 2.0.2 and have OAuth 2 configured.

When trying to access an instance page directly (when I am not yet authenticated), I am correctly redirected to the login page, but when authentication is complete I am not being redirected to the initial instance page but rather to the main page (applications list).

I believe the reason is the way Vue Router is configured (by default it uses hash mode).
https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations

In hash mode the server is not aware of the actual path (after #), so the final redirect just points it back to the root path.

This could be addressed by:

  1. Setting mode to history in VueRouter.
  2. Adding a server fallback to redirect to index when mapping does not exist.
  3. Change the instances/applications mapping to something else, so that it won't collide.
@joshiste
Copy link
Collaborator

joshiste commented Aug 9, 2018

Iirc, if you don't protect the static assets (ie / and /assets) then the UI redirects to the login (and not the server) and the fragments should be kept.

@joshiste
Copy link
Collaborator

joshiste commented Aug 9, 2018

  1. Change the instances/applications mapping to something else, so that it won't collide.

This is not necessary if the requested content-type is correctly considered, so that the html is not delivered for the json-requests....

@joshiste joshiste changed the title Deep linking to instance page with OAuth is not redirecting correctly Use history mode in Vue Router for better redirects after login for deep links Aug 9, 2018
@joshiste joshiste added this to the 2.2.0 milestone Mar 6, 2019
joshiste added a commit to joshiste/spring-boot-admin that referenced this issue Mar 18, 2019
joshiste added a commit that referenced this issue Mar 18, 2019
@joshiste
Copy link
Collaborator

@asibross I'd be happy if you could test one of our snapshot versions...

@asibross
Copy link
Contributor Author

Hey @joshiste, thanks for merging. I see that this is part of the 2.2 release. I currently don't have a stable version for our internal solution with 2.2. I will try to get something this week, so I will be able to test it.

asibross pushed a commit to asibross/spring-boot-admin that referenced this issue Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants