-
Notifications
You must be signed in to change notification settings - Fork 99
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
Infinite redirection loop with vue-router default mode "hash" #1
Comments
Hi! Sorry for the really late reply. |
Hi, no problem. |
I have this same problem, but it seems that it is not only with Vue.js, other frameworks suffer from this issue to as per I will use the history mode in the meantime Good Luck! |
I've experienced this infinite redirect and I have a workaround to allow you to continue to use the default hash mode with the VueRouter. Take a look at how I initialize my vue app:
Essentially, we need to wait until Keycloak is done doing its thing before installing the VueRouter plugin. However, now i'm running into another (minor) issue.
When I log back in I will end up at /#/dashboard instead if /#/admin |
Is anybody actively working on a fix/work around for this issue? |
No, but any help would be greatly appreciated! |
Hi all! I also encountered this issue and found a workaround (as delaying the vue-router like @ChuckFields didnt work for me): actually my router runs after the VueKeycloak init anyways but still it turned around and around and around on itself... So, I switched from "login-required" to the "check-sso" mode, BUT, to be able to still get redirected to my keycloak interface, I put this in my router.js: router.beforeEach((to, from, next) => {
if (!router.app.$keycloak.authenticated) {
window.location.replace(router.app.$keycloak.createLoginUrl());
}
(...)
next();
} |
At the date of this writing I was able to fix this by enabling third-party cookies in Chrome & Safari and Shields Off for Brave. The checkLoginIframe:false checking false solution didn't fix it for me. The issue doesn't affect MS Edge as of this writing. |
Hi,
it's more a question that a real issue, because I'm not sure if I configured something wrong or if I missed something.
The plugin works great with vue and vue-router when it's configured to use the mode history. If the default mode "hash" is set, after completing login, the page is redirected indefinitely.
Do you have any clue?
Thanks!
The text was updated successfully, but these errors were encountered: