diff --git a/web/app/signin/components/sso-auth.tsx b/web/app/signin/components/sso-auth.tsx index f48ace97e4a15d..c665433d305cc0 100644 --- a/web/app/signin/components/sso-auth.tsx +++ b/web/app/signin/components/sso-auth.tsx @@ -28,6 +28,8 @@ const SSOAuth: FC = ({ if (protocol === SSOProtocol.SAML) { getUserSAMLSSOUrl(invite_token).then((res) => { router.push(res.url) + }).catch(() => { + toast.error(t('error.ssoFailed', { ns: 'login' })) }).finally(() => { setIsLoading(false) }) @@ -36,6 +38,8 @@ const SSOAuth: FC = ({ getUserOIDCSSOUrl(invite_token).then((res) => { document.cookie = `user-oidc-state=${res.state};Path=/` router.push(res.url) + }).catch(() => { + toast.error(t('error.ssoFailed', { ns: 'login' })) }).finally(() => { setIsLoading(false) }) @@ -44,6 +48,8 @@ const SSOAuth: FC = ({ getUserOAuth2SSOUrl(invite_token).then((res) => { document.cookie = `user-oauth2-state=${res.state};Path=/` router.push(res.url) + }).catch(() => { + toast.error(t('error.ssoFailed', { ns: 'login' })) }).finally(() => { setIsLoading(false) }) diff --git a/web/i18n/en-US/login.json b/web/i18n/en-US/login.json index 87efaf5a234179..ad6700097eb965 100644 --- a/web/i18n/en-US/login.json +++ b/web/i18n/en-US/login.json @@ -28,6 +28,8 @@ "error.invalidEmailOrPassword": "Invalid email or password.", "error.invalidRedirectUrlOrAppCode": "Invalid redirect URL or app code", "error.invalidSSOProtocol": "Invalid SSO protocol", + "error.ssoFailed": "SSO login failed. Please try again or contact your administrator.", + "error.unknown": "Something went wrong. Please try again.", "error.nameEmpty": "Name is required", "error.passwordEmpty": "Password is required", "error.passwordInvalid": "Password must contain letters and numbers, and the length must be greater than 8",