diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d077e582..42b5b75f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,6 +11,14 @@ updates: interval: monthly cooldown: default-days: 3 + groups: + react: + patterns: + - react + - react-dom + - '@types/react' + - '@types/react-dom' + - '@vitejs/plugin-react' - package-ecosystem: nuget directory: / schedule: diff --git a/samples/AspNetCoreReactSample/ClientApp/src/components/Login.tsx b/samples/AspNetCoreReactSample/ClientApp/src/components/Login.tsx index d775bb79..1c5a00c1 100644 --- a/samples/AspNetCoreReactSample/ClientApp/src/components/Login.tsx +++ b/samples/AspNetCoreReactSample/ClientApp/src/components/Login.tsx @@ -1,34 +1,12 @@ import { useCallback, useEffect, useMemo, useState } from 'react'; import { UserManager } from '../api'; -const MAX_RETRIES = 5; -const RETRY_DELAY_MS = 1000; - export function Login(): React.JSX.Element { const userManager = useMemo(() => new UserManager(), []); const [schemes, setSchemes] = useState([]); - const [loading, setLoading] = useState(true); const fetchSchemes = useCallback(async () => { - setLoading(true); - for (let attempt = 0; attempt < MAX_RETRIES; attempt++) { - try { - const result = await userManager.getAuthenticationSchemes(); - if (result && result.length > 0) { - setSchemes(result); - setLoading(false); - return; - } - } catch { - // Transient error (e.g. proxy not ready yet), retry - } - if (attempt < MAX_RETRIES - 1) { - await new Promise((resolve) => - setTimeout(resolve, RETRY_DELAY_MS * (attempt + 1)) - ); - } - } - setLoading(false); + setSchemes(await userManager.getAuthenticationSchemes()); }, [userManager]); useEffect(() => { @@ -38,20 +16,16 @@ export function Login(): React.JSX.Element { return ( <>

Choose an authentication scheme

- {loading ? ( -

Loading...

- ) : ( - schemes.map((scheme) => ( - - )) - )} + {schemes.map((scheme) => ( + + ))} ); }