diff --git a/frontend/src/lib/i18n/locales/en-US.json b/frontend/src/lib/i18n/locales/en-US.json index bf20dfd..e0ca837 100644 --- a/frontend/src/lib/i18n/locales/en-US.json +++ b/frontend/src/lib/i18n/locales/en-US.json @@ -49,5 +49,5 @@ "forgotPasswordTitle": "Forgot your password?", "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", "errorTitle": "An error occurred", - "errorSubtitle": "An error occured while trying to perform this action. Please check the console for more information." + "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information." } \ No newline at end of file diff --git a/frontend/src/lib/i18n/locales/en.json b/frontend/src/lib/i18n/locales/en.json index bf20dfd..e0ca837 100644 --- a/frontend/src/lib/i18n/locales/en.json +++ b/frontend/src/lib/i18n/locales/en.json @@ -49,5 +49,5 @@ "forgotPasswordTitle": "Forgot your password?", "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", "errorTitle": "An error occurred", - "errorSubtitle": "An error occured while trying to perform this action. Please check the console for more information." + "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information." } \ No newline at end of file diff --git a/frontend/src/pages/login-page.tsx b/frontend/src/pages/login-page.tsx index 3cf1a03..37695de 100644 --- a/frontend/src/pages/login-page.tsx +++ b/frontend/src/pages/login-page.tsx @@ -16,7 +16,7 @@ import { useUserContext } from "@/context/user-context"; import { useIsMounted } from "@/lib/hooks/use-is-mounted"; import { LoginSchema } from "@/schemas/login-schema"; import { useMutation } from "@tanstack/react-query"; -import axios from "axios"; +import axios, { AxiosError } from "axios"; import { useEffect } from "react"; import { useTranslation } from "react-i18next"; import { Navigate, useLocation } from "react-router"; @@ -85,11 +85,12 @@ export const LoginPage = () => { ); }, 500); }, - onError: (error: Error) => { + onError: (error: AxiosError) => { toast.error(t("loginFailTitle"), { - description: error.message.includes("429") - ? t("loginFailRateLimit") - : t("loginFailSubtitle"), + description: + error.response?.status === 429 + ? t("loginFailRateLimit") + : t("loginFailSubtitle"), }); }, });