change(ui): iframe check for sso redirect
This commit is contained in:
parent
fc531ceb85
commit
5ca1923ef4
1 changed files with 9 additions and 1 deletions
|
|
@ -64,6 +64,14 @@ const Login: React.FC<LoginProps> = ({errors, loading, authDetails, login, setJw
|
|||
}
|
||||
};
|
||||
|
||||
const onSSOClick = () => {
|
||||
if (params.get('iframe')) {
|
||||
window.parent.location.href = "/api/sso/saml2?iFrame=true";
|
||||
} else {
|
||||
window.location.href = "/api/sso/saml2";
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex items-center justify-center h-screen">
|
||||
<div className="flex flex-col items-center">
|
||||
|
|
@ -189,7 +197,7 @@ const Login: React.FC<LoginProps> = ({errors, loading, authDetails, login, setJw
|
|||
</div>
|
||||
<div
|
||||
className={cn("flex items-center w-96 justify-center my-8", {'hidden': !authDetails.enforceSSO})}>
|
||||
<a href="/api/sso/saml2" rel="noopener noreferrer">
|
||||
<a href="#" rel="noopener noreferrer" onClick={onSSOClick}>
|
||||
<Button variant="primary">{`Login with SSO ${
|
||||
authDetails.ssoProvider ? `(${authDetails.ssoProvider})` : ''
|
||||
}`}</Button>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue