change(ui): iframe check and sso redirect

This commit is contained in:
Shekar Siri 2024-02-20 12:01:53 +01:00
parent 17055eb2ae
commit 75383e6d50

View file

@ -65,12 +65,12 @@ const Login: React.FC<LoginProps> = ({errors, loading, authDetails, login, setJw
};
const onSSOClick = () => {
if (params.get('iframe')) {
if (window !== window.top) { // if in iframe
window.parent.location.href = `${window.location.origin}/api/sso/saml2?iFrame=true`;
} else {
window.location.href = `${window.location.origin}/api/sso/saml2`;
}
}
};
return (
<div className="flex items-center justify-center h-screen">