I am facing an issue after implementing keycloaks into my react app. The issue is I want to prevent the users from redirecting back to the keycloaks custom login screen from the dashboard once they have already logged in and has a token. I am using tanstack router for handling the routes. I tried many ways but none of them worked, and I need immediate assistance on this Thank you . Here is my keycloaks initialization code:
if (!initPromise) {
initPromise = keycloakInstance.init({
onLoad: "check-sso",
silentCheckSsoRedirectUri: `${window.location.origin}/silent-check-sso.html`,
pkceMethod: "S256",
});
}