-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Quasar - hashmode leads into wrong redirect by using vue-keycloak #10062
Comments
Update: quasar.conf.js
By using "hash" i will get redirected wrong: By using "history" i will get redirected correctly: But this only happens by using quasar. By using the vue-typescript example in router hashmode it works correctly. And also without parameters in url. |
After the upgrade, I have the same problem. |
@nucle The question now is whether it is a quasar or library problem. |
It's not related to Quasar. |
The package works (in beta) already with Vue 3 (Vue Router 4). https://github.com/dsb-norge/vue-keycloak-js And the examples also works with no problem. Just with quasar i got the redirection problem |
The "hello" example requires vue 2 and vue-router 3, and the ts-vue3 example does not uses vue-router. |
Hi, i have the same problem but i don't use the vue-keycloak-js package. I am using the plain Js version from Keycloak. I saw u updated the vue3 router. I will try it again on Monday. Then i can tell u if i have the problem. |
There's nothing special about Quasar in regards to routing when compared to a regular vue-cli app with vue-router. So whatever the problem is, it's not related to Quasar. Now, I'd like to help investigate so we can raise a ticket to the appropriate repository. Unfortunately, time is limited because of the many other tickets related directly to a Quasar issue. So someone please create a basic repo with this wonder package and vue 3 + vue-router 4 (configured in hash mode). If there's no problem, we can start investigating from there. But again, as Quasar does not handle routing by itself (it lets vue-router do it, and its configuration matters), if done right then this should be reproducible from the a basic repo with vue3+vue-router4. Due to the lack of time, a repo like requested above would help move things forward. My guess on the problem: vue-keycloak-js just changes the window.location.href and does not triggers a window.reload() -- as it's kind of requested when working with a vue + vue-router setup in hash mode (it's just how vue-router works, outside of Quasar's reach which doesn't touches routing). @nucle Saying "I have the same problem but I don't use vue-keycloak-js" is not the same problem and it's not really helpful for investigation. The details matter. If you are referring to the boot files and the redirect() method then this has been solved in "@quasar/app" v3.1.4. However, that bug has nothing to do with what vue-keycloak-js does. The boot's redirect() method that can be called only by you in a Quasar boot file and all it does is just a dumb URL redirect. |
Why colosed ?
If use vueRouterMode is 'history', the url contains |
@rstoenescu i also opened a ticket at thier repostiory: dsb-norge/vue-keycloak-js#94 - but their we got redirected to quasar: "But again this does not seem like an issue with this plugin or keycloak/js in itself" |
Yes, I'm not sure whether is "vue-router 4.x"'s problem, but my project used "quasar": "^1.0.5" is normal, no happend this issue. |
Quasar v1 is used along VueRouter 3. Like I asked in my previous post, someone please create a basic repo with this wonder package and vue 3 + vue-router 4 (configured in hash mode). This would prove it's a Quasar issue. But like I explained, I'm 99.99% sure it isn't. |
Hello, I am facing the same issue hence I am not using dsb-norge/vue-keycloak-js, but keycloak-js directly from keycloak.org. |
Took a look at it and it's exactly what I expected. Vue Router v4 (in hash mode) + keycloak-js !== LOVE. Has nothing to do with Quasar. Again, routing is handled exclusively by Vue Router. If anyone is still stubborn to understand this, I can create an equivalent project (to this one from above, https://github.com/gnieser/quasar-keycloak ) without Quasar in it. |
Agreed. Let me demonstrate this for you: https://github.com/gnieser/vue-keycloak |
@rstoenescu so we need to open a ticket for keycloak-js to fix the compatibility problems with Vue Router v4, right? |
Yes |
If i logged in i will be redirected to the following url which leads to the 404 quasar error page instead to http://192.168.178.44:8080/.
http://192.168.178.44:8080/#/&state=671a7344-b7a0-4779-8fde-da8c99c6aa4a&session_state=a5598f7f-c11c-41f3-a777-883ac33f6ca1&code=c88b4a26-4bc4-4aca-93b5-5305b490ac37.a5698g7f-c11c-41f3-a777-883ac93f6ca1.3cb8d30d-4783-425a-bf33-3d79613bed10
In the example project (typescript_vue3 - hello_keycloak in the same repo, based on vue only) it redirects correctly. I checked the router but i could not get the error source.
boot/keycloak.ts
public/slient-check-sso.html
routes.ts
To Reproduce
Steps to reproduce the behavior:
http://192.168.178.44:8080/#/&state=671a7344-b7a0-4779-8fde-da8c99c6aa4a&session_state=a5598f7f-c11c-41f3-a777-883ac33f6ca1&code=c88b4a26-4bc4-4aca-93b5-5305b490ac37.a5698g7f-c11c-41f3-a777-883ac93f6ca1.3cb8d30d-4783-425a-bf33-3d79613bed10
Expected behavior
Like in the example project i should get redirected to home and the parameters in the url should disappear
http://192.168.178.44:8080/#/
Platform (please complete the following information):
Quasar Version: 2.0.2
@quasar/app Version: 3.0.2
Quasar mode:
Tested on:
OS: Arch Linux
Node: 16.4
NPM: 7.17
Yarn: 1.22.10
Browsers: Firefox
iOS: -
Android: -
Electron: -
Additional context
It seems to be a router problem which exist by using quasar cause the https://github.com/dsb-norge/vue-keycloak-js/tree/master/examples/ are working completly fine.
The text was updated successfully, but these errors were encountered: