diff --git a/src/common/components/LegacyAuthBanner/index.tsx b/src/common/components/LegacyAuthBanner/index.tsx deleted file mode 100644 index dee9848fa..000000000 --- a/src/common/components/LegacyAuthBanner/index.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { GlobalAlert } from '@appquality/unguess-design-system'; -import { forwardRef } from 'react'; -import { useTranslation } from 'react-i18next'; -import { useNavigate } from 'react-router-dom'; -import { useGetUsersMeQuery } from 'src/features/api'; -import { useLocalizeRoute } from 'src/hooks/useLocalizedRoute'; - -export const LegacyAuthBanner = forwardRef((_, ref) => { - const { t } = useTranslation(); - const { data: currentUser } = useGetUsersMeQuery(); - const navigate = useNavigate(); - const profileRoute = useLocalizeRoute('profile'); - - if (currentUser?.authType !== 'legacy') return null; - - return ( -
- navigate(`${profileRoute}?openPassword=true`), - }} - /> -
- ); -}); diff --git a/src/common/schema.ts b/src/common/schema.ts index 03a8c69ec..211da81f1 100644 --- a/src/common/schema.ts +++ b/src/common/schema.ts @@ -780,9 +780,6 @@ export interface paths { }; }; }; - "/users/me/token": { - get: operations["get-users-me-token"]; - }; "/ai/jobs": { post: operations["post-ai-jobs"]; }; @@ -5348,20 +5345,6 @@ export interface operations { 500: components["responses"]["Error"]; }; }; - "get-users-me-token": { - responses: { - /** OK */ - 200: { - content: { - "application/json": { - token: string; - }; - }; - }; - 400: components["responses"]["Error"]; - 403: components["responses"]["Error"]; - }; - }; "post-ai-jobs": { responses: { /** OK */ diff --git a/src/features/api/index.ts b/src/features/api/index.ts index 848a2b228..b031a5907 100644 --- a/src/features/api/index.ts +++ b/src/features/api/index.ts @@ -1025,12 +1025,6 @@ const injectedRtkApi = api.injectEndpoints({ method: 'DELETE', }), }), - getUsersMeToken: build.query< - GetUsersMeTokenApiResponse, - GetUsersMeTokenApiArg - >({ - query: () => ({ url: `/users/me/token` }), - }), postAiJobs: build.mutation({ query: (queryArg) => ({ url: `/ai/jobs`, @@ -2517,10 +2511,6 @@ export type DeleteCampaignsByCidWatchersAndProfileIdApiArg = { profileId: string; cid: string; }; -export type GetUsersMeTokenApiResponse = /** status 200 OK */ { - token: string; -}; -export type GetUsersMeTokenApiArg = void; export type PostAiJobsApiResponse = /** status 200 OK */ { original_input: string; output: string; @@ -3544,6 +3534,5 @@ export const { usePostWorkspacesByWidUsersMutation, useDeletePlansByPidWatchersAndProfileIdMutation, useDeleteCampaignsByCidWatchersAndProfileIdMutation, - useGetUsersMeTokenQuery, usePostAiJobsMutation, } = injectedRtkApi; diff --git a/src/features/navigation/Navigation/index.tsx b/src/features/navigation/Navigation/index.tsx index 61316325d..03e6bc2d3 100644 --- a/src/features/navigation/Navigation/index.tsx +++ b/src/features/navigation/Navigation/index.tsx @@ -1,16 +1,8 @@ import { Content } from '@appquality/unguess-design-system'; -import { - ComponentProps, - useCallback, - useEffect, - useMemo, - useRef, - useState, -} from 'react'; +import { ComponentProps, useEffect, useMemo } from 'react'; import { useParams } from 'react-router-dom'; import { useAppDispatch } from 'src/app/hooks'; import { appTheme } from 'src/app/theme'; -import { LegacyAuthBanner } from 'src/common/components/LegacyAuthBanner'; import { AppSidebar } from 'src/common/components/navigation/sidebar'; import { setSidebarOpen, @@ -26,14 +18,13 @@ import { NavigationProfileModal } from './NavigationProfileModal'; const StyledContent = styled(Content)< ComponentProps & { $isMinimal?: boolean; - $bannerHeight?: number; children?: React.ReactNode; } >` - height: ${({ $isMinimal, $bannerHeight = 0, theme }) => + height: ${({ $isMinimal, theme }) => $isMinimal ? '100%' - : `calc(100% - ${theme.components.chrome.header.height} - ${$bannerHeight}px)`}; + : `calc(100% - ${theme.components.chrome.header.height})`}; `; export const Navigation = ({ @@ -93,31 +84,13 @@ export const Navigation = ({ dispatch(toggleSidebar()); }; - const [bannerHeight, setBannerHeight] = useState(0); - const bannerObserverRef = useRef(null); - const bannerRefCallback = useCallback((node: HTMLDivElement | null) => { - bannerObserverRef.current?.disconnect(); - if (!node) { - bannerObserverRef.current = null; - setBannerHeight(0); - return; - } - setBannerHeight(node.getBoundingClientRect().height); - const observer = new ResizeObserver((entries) => { - setBannerHeight(entries[0].contentRect.height); - }); - observer.observe(node); - bannerObserverRef.current = observer; - }, []); - if (!activeWorkspace && !isLoading) return ; return ( <> - {!isMinimal && } - + Forgot password?. Otherwise, please try again.", + "__LOGIN_FORM_INVALID_CREDENTIALS_ALERT_TITLE": "Trouble logging in?", + "__LOGIN_FORM_INVALID_CREDENTIALS_TOAST": "Invalid credentials. Please try again or update your password", "__LOGIN_FORM_NO_ACCOUNT_LABEL": "Don't have an account?", "__LOGIN_FORM_PASSWORD_FORGOT_LABEL": "Forgot password?", "__LOGIN_FORM_PASSWORD_LABEL": "Password", "__LOGIN_FORM_PASSWORD_PLACEHOLDER": "Enter password", "__LOGIN_FORM_SIGNUP_CTA": "Sign up", - "__LOGIN_FORM_SSO_INFO_MESSAGE": "To comply with new security protocols, please update your password by May 12, 2026.", - "__LOGIN_FORM_SSO_INFO_TITLE": "Update your password for data security", "__LOGIN_FORM_SUBTITLE": "Log in to your UNGUESS account", "__LOGIN_FORM_TITLE": "Welcome back!", "__LOGIN_SESSION_EXPIRED_MESSAGE": "Your session has expired. Please log in again.", @@ -1398,7 +1399,6 @@ "__PROFILE_PAGE_SECURITY_CARD_LABEL": "Security settings", "__PROFILE_PAGE_SECURITY_CONTACT_SUPPORT": "Contact support", "__PROFILE_PAGE_SECURITY_LEGACY_ALERT_MESSAGE": "To upgrade your account protection, please change your password by May 12, 2026. Note that your new password cannot match the current one. This update is a mandatory prerequisite for enabling two-factor authentication.", - "__PROFILE_PAGE_SECURITY_LEGACY_ALERT_TITLE": "Security update: change your password", "__PROFILE_PAGE_SECURITY_NEED_HELP": "Need help?", "__PROFILE_PAGE_SURNAME_REQUIRED_ERROR": "Surname is required", "__PROFILE_PAGE_TITLE": "My Profile", diff --git a/src/locales/it/translation.json b/src/locales/it/translation.json index 2dd3c6bcb..adbc5917d 100644 --- a/src/locales/it/translation.json +++ b/src/locales/it/translation.json @@ -737,13 +737,14 @@ "__LOGIN_FORM_EMAIL_LABEL": "Email di lavoro", "__LOGIN_FORM_EMAIL_PLACEHOLDER": "nome@azienda.com", "__LOGIN_FORM_FAILED_INVALID": "L'indirizzo email o la password non sono corretti.", + "__LOGIN_FORM_INVALID_CREDENTIALS_ALERT_MESSAGE": "", + "__LOGIN_FORM_INVALID_CREDENTIALS_ALERT_TITLE": "", + "__LOGIN_FORM_INVALID_CREDENTIALS_TOAST": "", "__LOGIN_FORM_NO_ACCOUNT_LABEL": "Non hai un account?", "__LOGIN_FORM_PASSWORD_FORGOT_LABEL": "Password dimenticata?", "__LOGIN_FORM_PASSWORD_LABEL": "Password", "__LOGIN_FORM_PASSWORD_PLACEHOLDER": "Inserisci password", "__LOGIN_FORM_SIGNUP_CTA": "Registrati", - "__LOGIN_FORM_SSO_INFO_MESSAGE": "", - "__LOGIN_FORM_SSO_INFO_TITLE": "", "__LOGIN_FORM_SUBTITLE": "Accedi al tuo account UNGUESS", "__LOGIN_FORM_TITLE": "Bentornato!", "__LOGIN_SESSION_EXPIRED_MESSAGE": "La sessione è scaduta. Effettua nuovamente il login.", @@ -1432,7 +1433,6 @@ "__PROFILE_PAGE_SECURITY_CARD_LABEL": "Impostazioni di sicurezza", "__PROFILE_PAGE_SECURITY_CONTACT_SUPPORT": "Contatta il supporto", "__PROFILE_PAGE_SECURITY_LEGACY_ALERT_MESSAGE": "To protect your work, please update your password by [Date]. This update is required to enable two-factor authentication or to switch to Single Sign-On by contacting your CSM.", - "__PROFILE_PAGE_SECURITY_LEGACY_ALERT_TITLE": "Update your security settings", "__PROFILE_PAGE_SECURITY_NEED_HELP": "Hai bisogno di aiuto?", "__PROFILE_PAGE_SURNAME_REQUIRED_ERROR": "", "__PROFILE_PAGE_TITLE": "Profilo", diff --git a/src/pages/JoinPage/SignupPage/SignupForm.tsx b/src/pages/JoinPage/SignupPage/SignupForm.tsx index c6771595b..f850c0b29 100644 --- a/src/pages/JoinPage/SignupPage/SignupForm.tsx +++ b/src/pages/JoinPage/SignupPage/SignupForm.tsx @@ -313,12 +313,7 @@ export const SignupForm = ({ onSignupSuccess }: SignupFormProps) => { isPrimary isAccent isStretched - disabled={ - isSubmitting || - !isValid || - !values.termsAccepted || - !values.privacyAccepted - } + disabled={isSubmitting} style={{ marginTop: appTheme.space.sm }} > {isSubmitting ? t('LOADING') : t('SIGNUP_FORM_SUBMIT')} diff --git a/src/pages/JoinPage/SignupPage/validationSchema.ts b/src/pages/JoinPage/SignupPage/validationSchema.ts index 36e41eb77..326e97e7f 100644 --- a/src/pages/JoinPage/SignupPage/validationSchema.ts +++ b/src/pages/JoinPage/SignupPage/validationSchema.ts @@ -27,7 +27,7 @@ export const getSignupValidationSchema = (t: TFunction) => 'mac.com', 'aol.com', 'protonmail.com', - 'Proton: Privacy by default', + 'proton.me', 'gmx.com', 'gmx.net', 'mail.com', diff --git a/src/pages/LoginPage/LoginForm.tsx b/src/pages/LoginPage/LoginForm.tsx index 0b3413a3e..96eef2d6c 100644 --- a/src/pages/LoginPage/LoginForm.tsx +++ b/src/pages/LoginPage/LoginForm.tsx @@ -12,13 +12,13 @@ import { MD, MediaInput, Message, - Span, Title, XL, } from '@appquality/unguess-design-system'; import { ReactComponent as EyeIcon } from '@zendeskgarden/svg-icons/src/16/eye-fill.svg'; import { ReactComponent as EyeOffIcon } from '@zendeskgarden/svg-icons/src/16/eye-hide-fill.svg'; import { appTheme } from 'src/app/theme'; +import { useLocalizeRoute } from 'src/hooks/useLocalizedRoute'; import { LoginFormFields } from './type'; const StyledCard = styled(ContainerCard)` @@ -58,6 +58,7 @@ interface LoginFormProps { const LoginForm = ({ onSubmit, buttonText }: LoginFormProps) => { const { t } = useTranslation(); const [showPassword, setShowPassword] = useState(false); + const forgotPasswordRoute = useLocalizeRoute('forgot-password'); const validate = (values: LoginFormFields) => { const errors: Partial> = {}; @@ -167,7 +168,7 @@ const LoginForm = ({ onSubmit, buttonText }: LoginFormProps) => { )} { > {t('__LOGIN_FORM_PASSWORD_FORGOT_LABEL')} + {status?.type === 'invalid' && ( + + + {t('__LOGIN_FORM_INVALID_CREDENTIALS_ALERT_TITLE')} + + + ), + }} + /> + + )}