feat: introduce role mappings form on authentication page (#1256)

This commit is contained in:
kattoczko
2023-09-08 13:09:53 +01:00
committed by GitHub
parent ff66548462
commit d63757634a
12 changed files with 506 additions and 194 deletions

View File

@@ -1,20 +1,22 @@
import { useQuery } from '@apollo/client';
import { QueryResult, useQuery } from '@apollo/client';
import { TSamlAuthProvider } from '@automatisch/types';
import { GET_SAML_AUTH_PROVIDER } from 'graphql/queries/get-saml-auth-provider';
type UseSamlAuthProviderReturn = {
provider: TSamlAuthProvider;
provider?: TSamlAuthProvider;
loading: boolean;
refetch: QueryResult<TSamlAuthProvider | undefined>['refetch'];
};
export default function useSamlAuthProvider(): UseSamlAuthProviderReturn {
const { data, loading } = useQuery(GET_SAML_AUTH_PROVIDER, {
const { data, loading, refetch } = useQuery(GET_SAML_AUTH_PROVIDER, {
context: { autoSnackbar: false },
});
return {
provider: data?.getSamlAuthProvider,
loading,
refetch,
};
}