Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions web/src/i18n/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,7 @@ const en: BaseTranslation = {
number: 'Expected a valid number.',
minimumValue: `Minimum value of {value: number} not reached.`,
maximumValue: 'Maximum value of {value: number} exceeded.',
tooManyBadLoginAttempts: `Too many bad login attempts. Please try again in a few minutes.`,
},
floatingErrors: {
title: 'Please correct the following:',
Expand Down
8 changes: 8 additions & 0 deletions web/src/i18n/i18n-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2096,6 +2096,10 @@ type RootTranslation = {
* @param {number} value
*/
maximumValue: RequiredParams<'value'>
/**
* T​o​o​ ​m​a​n​y​ ​b​a​d​ ​l​o​g​i​n​ ​a​t​t​e​m​p​t​s​.​ ​P​l​e​a​s​e​ ​t​r​y​ ​a​g​a​i​n​ ​i​n​ ​a​ ​f​e​w​ ​m​i​n​u​t​e​s​.
*/
tooManyBadLoginAttempts: string
}
floatingErrors: {
/**
Expand Down Expand Up @@ -6084,6 +6088,10 @@ export type TranslationFunctions = {
* Maximum value of {value} exceeded.
*/
maximumValue: (arg: { value: number }) => LocalizedString
/**
* Too many bad login attempts. Please try again in a few minutes.
*/
tooManyBadLoginAttempts: () => LocalizedString
}
floatingErrors: {
/**
Expand Down
2 changes: 2 additions & 0 deletions web/src/i18n/pl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,8 @@ Uwaga, podane tutaj konfiguracje nie posiadają klucza prywatnego. Musisz uzupe
repeat: 'Wartości się nie pokrywają.',
maximumValue: 'Maksymalna wartość {value} przekroczona.',
minimumValue: 'Minimalna wartość {value} nie osiągnięta.',
tooManyBadLoginAttempts:
'Zbyt duża ilość nieprawidłowego logowania. Spróbuj ponownie za kilka minut.',
number: 'Wartość musi być liczbą.',
},
floatingErrors: {
Expand Down
3 changes: 3 additions & 0 deletions web/src/pages/auth/Login/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
import { LoaderSpinner } from '../../../shared/defguard-ui/components/Layout/LoaderSpinner/LoaderSpinner';
import { useAuthStore } from '../../../shared/hooks/store/useAuthStore';
import useApi from '../../../shared/hooks/useApi';
import { useToaster } from '../../../shared/hooks/useToaster';
import { MutationKeys } from '../../../shared/mutations';
import { patternSafeUsernameCharacters } from '../../../shared/patterns';
import { QueryKeys } from '../../../shared/queries';
Expand All @@ -37,6 +38,7 @@ export const Login = () => {
openid: { getOpenIdInfo: getOpenidInfo },
},
} = useApi();
const toaster = useToaster();

const { data: openIdInfo, isLoading: openIdLoading } = useQuery({
queryKey: [QueryKeys.FETCH_OPENID_INFO],
Expand Down Expand Up @@ -88,6 +90,7 @@ export const Login = () => {
);
} else {
console.error(error);
toaster.error(LL.form.error.tooManyBadLoginAttempts());
}
},
});
Expand Down