Hi,
I have conflicts between two applications using the same user in same keycloak realm. I want to understand if I did some configuration wrong or if its the expected behavior.
scenario:
I have two nextjs apps foo and bar.
I have two keycloak public clients foo-frontend and bar-frontend.
User access foo.com. No session. User logs in. User redirected to foo app.
User access bar.com. There is as session. No login required. User access bar app.
Session expires (or I manually end session trough keycloak admin console).
User try to navigate in foo app. Redirected to login page. User login back.
User try to navigate in bar app. Got this page:

Questions: why I’m seeing this page if I’m logged? (both foo and bar apps are in the same browser session. no tab closes, nothing). Is there any way to not be redirected to this page? If user tries to access bar app url instead Logout option he can access application again without a new login. Sounds confusing to users.
Also I discovered two other keycloak pages interacting with foo and bar apps at same time that I could not reproduce/understand:


Questions: what are the situations that user can fall in this pages? Sounds confusing to users, since there is no “go back” option to him. If I access foo or bar url apps again there is no problem.
Can I improve user experience to not fall in this conflicting situations?
Thanks in advance