fix: external redirect issue
This commit is contained in:
@@ -1,6 +1,4 @@
|
|||||||
import LogoIcon from '@/assets/images/gpustack-logo.png';
|
import LogoIcon from '@/assets/images/gpustack-logo.png';
|
||||||
import OIDCIcon from '@/assets/images/oidc.svg';
|
|
||||||
import SAMLIcon from '@/assets/images/saml.svg';
|
|
||||||
import { userAtom } from '@/atoms/user';
|
import { userAtom } from '@/atoms/user';
|
||||||
import LangSelect from '@/components/lang-select';
|
import LangSelect from '@/components/lang-select';
|
||||||
import ThemeDropActions from '@/components/theme-toggle/theme-drop-actions';
|
import ThemeDropActions from '@/components/theme-toggle/theme-drop-actions';
|
||||||
@@ -34,9 +32,11 @@ const BackButton = styled(Button).attrs({
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const ButtonWrapper = styled(Button).attrs({
|
const ButtonWrapper = styled(Button).attrs({
|
||||||
shape: 'round',
|
type: 'primary',
|
||||||
block: true
|
block: true
|
||||||
})``;
|
})`
|
||||||
|
height: 48px;
|
||||||
|
`;
|
||||||
|
|
||||||
const ButtonText = styled.span`
|
const ButtonText = styled.span`
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -201,7 +201,6 @@ const LoginForm = () => {
|
|||||||
{SSOAuth.options.oidc && (
|
{SSOAuth.options.oidc && (
|
||||||
<ButtonWrapper onClick={SSOAuth.loginWithOIDC}>
|
<ButtonWrapper onClick={SSOAuth.loginWithOIDC}>
|
||||||
<ButtonText>
|
<ButtonText>
|
||||||
<img src={OIDCIcon} alt="" height={24} width={24} />
|
|
||||||
{intl.formatMessage(
|
{intl.formatMessage(
|
||||||
{ id: 'common.external.login' },
|
{ id: 'common.external.login' },
|
||||||
{ type: 'OIDC' }
|
{ type: 'OIDC' }
|
||||||
@@ -212,7 +211,6 @@ const LoginForm = () => {
|
|||||||
{SSOAuth.options.saml && (
|
{SSOAuth.options.saml && (
|
||||||
<ButtonWrapper onClick={SSOAuth.loginWithSAML}>
|
<ButtonWrapper onClick={SSOAuth.loginWithSAML}>
|
||||||
<ButtonText>
|
<ButtonText>
|
||||||
<img src={SAMLIcon} alt="" height={24} width={24} />
|
|
||||||
{intl.formatMessage(
|
{intl.formatMessage(
|
||||||
{ id: 'common.external.login' },
|
{ id: 'common.external.login' },
|
||||||
{ type: 'SAML' }
|
{ type: 'SAML' }
|
||||||
|
|||||||
@@ -57,10 +57,13 @@ export function useSSOAuth({
|
|||||||
oidcLogin();
|
oidcLogin();
|
||||||
} else if (authConfig.is_saml) {
|
} else if (authConfig.is_saml) {
|
||||||
samlLogin();
|
samlLogin();
|
||||||
|
} else {
|
||||||
|
onError?.(new Error('No SSO configuration found'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch {
|
} catch (error: any) {
|
||||||
setLoginOption({ oidc: false, saml: false });
|
setLoginOption({ oidc: false, saml: false });
|
||||||
|
onError?.(error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ const Wrapper = styled.div<{ $isDarkTheme: boolean }>`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const Box = styled.div`
|
const Box = styled.div`
|
||||||
padding-top: 8%;
|
padding-top: 10%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|||||||
Reference in New Issue
Block a user