question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Infinite reload/loop when switching language with useKcLanguageTag

See original GitHub issue

Hi,

First, thank you for this very useful lib 🙏 !

I’ve experienced some infinite reload / loop on my keycloakify theme in specific cases.

To reproduce

  • Go to login page
  • Delete all cookies related to keycloak and local storage
  • Switch language with selector

=> Infinite loop should happen at this point => error.ftl template should be reloaded infinitely (or try again switching the language the other way around if it doesn’t happen)

Probable issue

The locale as within the page is not the same as the one in local storage. image

image In this case the app keeps redirecting to kc_locale=fr but keycloak keeps returning the page in english. => If we remove this item in local storage the language switch is canceled and the page stays in english.

Do you have any idea how we could fix this?

Thanks 🙌

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Romcolcommented, Apr 12, 2022

Thank you for the comprehensive explanation @garronej!

Indeed, the language switch doesn’t work on error.ftl, even with the default theme so there’s no better solution. The only issue I see is when you allow language switch on this page for the client, you end up having two different languages on the same page, the client being translated to the language your requested but with the inner messages in the previous language. I’m actually not sure if there’s a real benefit in changing the language in the client instead of redirecting to the page directly.

I found as well that the same issue is present at least in these pages: info.ftl, login-page-expired.ftl. It’s better to disable the language switch on these templates and make sure it can’t trigger an infinite loop.

Cheers,

2reactions
garronejcommented, Apr 9, 2022

I think it will be an easy fix but I first need to be able to run a local container of keycloak to debug.
I just upgraded to an M1 Mac, it no longer works. Luckily the community have sorted it out already

Read more comments on GitHub >

github_iconTop Results From Across the Web

Infinite loop when I try to redirect according to browser language
Simply redirecting doesn't change the navigator language. So, even on /en/ I'd expect it to try to redirect again. You might want this:...
Read more >
MuH - River Thames Conditions
Tragumna beach, Pollywogg holler, #switch ep 38, Allergies vs cold in ... Pengertian ragangan, High context low context language, White and black head...
Read more >
ANL-7411 Supplement 9 Mathematics and Computers (UC-32)
C = control or operating system language statements, ... TEMPER/MURE CHANGE FOR A SLRFACE NODE IS CALCULATEC EY APPLYING.
Read more >
CVE - Search Results - MITRE
4, "nimble refresh" fetches a list of Nimble packages over HTTPS without full verification of the SSL/TLS certificate due to the default setting...
Read more >
sera Herbs´n´Loops Nature 1000 ml - Sera.cz
Tento výrobek patří do produktové linie "sera Nature" a nevyžaduje žádná barviva a konzervační látky. Barvy různých druhů krmiv pochází z přírodních ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found