Infinite reload/loop when switching language with useKcLanguageTag
See original GitHub issueHi,
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.

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:
- Created a year ago
- Reactions:1
- Comments:9 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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,
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