Merge pull request #1725 from automatisch/AUT-838

refactor: rewrite useSamlAuthProviders with RQ
This commit is contained in:
Ali BARIN
2024-03-15 15:28:01 +01:00
committed by GitHub
12 changed files with 52 additions and 48 deletions

View File

@@ -3,19 +3,25 @@ import Paper from '@mui/material/Paper';
import Button from '@mui/material/Button';
import Stack from '@mui/material/Stack';
import Divider from '@mui/material/Divider';
import useSamlAuthProviders from 'hooks/useSamlAuthProviders.ee';
import useFormatMessage from 'hooks/useFormatMessage';
function SsoProviders() {
const formatMessage = useFormatMessage();
const { providers, loading } = useSamlAuthProviders();
if (!loading && providers.length === 0) return null;
const { data, isLoading: isSamlAuthProvidersLoading } =
useSamlAuthProviders();
const providers = data?.data;
if (!isSamlAuthProvidersLoading && providers?.length === 0) return null;
return (
<>
<Divider>{formatMessage('loginPage.divider')}</Divider>
<Paper sx={{ px: 2, py: 4 }}>
<Stack direction="column" gap={1}>
{providers.map((provider) => (
{providers?.map((provider) => (
<Button
key={provider.id}
component="a"