I'm using keycloak-react/web and keycloak-js packages in my React project. This is what I have in my keycloak.js
import Keycloak from 'keycloak-js'
const host = window.location.host
const keycloak = new Keycloak({
url: `http://localhost:8080/auth`,
realm: 'demo',
clientId: 'demo',
})
export default keycloak
And this is how I logout the sso-logged-in user
{
!!keycloak.authenticated && (
<li>
<a href='/#' onClick={() => keycloak.logout()}>Logout</a>
</li>
)
}
This used to work fine till I switched to keycloak v18.x.x Quarkus. Now, it doesn't even logout the user, let along redirect them to the homepage. What I understand from their documentation, which is stated in this answer, is that they've changed the mechanism to logout. But what I don't understand is how and where do I use this post_logout_redirect_uri
Update: I updated the JavaScript adapter (keycloak-js) to v19.0.1 which at least logs-out the user now but still haven't figured out how to redirect back to the login page