diff --git a/frontend/src/pages/project/IdentityDetailsByIDPage/components/ProjectIdentityAuthSection.tsx b/frontend/src/pages/project/IdentityDetailsByIDPage/components/ProjectIdentityAuthSection.tsx index 6311267a39..64066957c2 100644 --- a/frontend/src/pages/project/IdentityDetailsByIDPage/components/ProjectIdentityAuthSection.tsx +++ b/frontend/src/pages/project/IdentityDetailsByIDPage/components/ProjectIdentityAuthSection.tsx @@ -55,47 +55,6 @@ export const ProjectIdentityAuthenticationSection = ({ identity, refetchIdentity const hasAuthMethods = Boolean(identity.authMethods.length); - const { mutateAsync: revokeUniversalAuth } = useDeleteIdentityUniversalAuth(); - const { mutateAsync: revokeTokenAuth } = useDeleteIdentityTokenAuth(); - const { mutateAsync: revokeKubernetesAuth } = useDeleteIdentityKubernetesAuth(); - const { mutateAsync: revokeGcpAuth } = useDeleteIdentityGcpAuth(); - const { mutateAsync: revokeTlsCertAuth } = useDeleteIdentityTlsCertAuth(); - const { mutateAsync: revokeAwsAuth } = useDeleteIdentityAwsAuth(); - const { mutateAsync: revokeAzureAuth } = useDeleteIdentityAzureAuth(); - const { mutateAsync: revokeAliCloudAuth } = useDeleteIdentityAliCloudAuth(); - const { mutateAsync: revokeOciAuth } = useDeleteIdentityOciAuth(); - const { mutateAsync: revokeOidcAuth } = useDeleteIdentityOidcAuth(); - const { mutateAsync: revokeJwtAuth } = useDeleteIdentityJwtAuth(); - const { mutateAsync: revokeLdapAuth } = useDeleteIdentityLdapAuth(); - - const RemoveAuthMap = { - [IdentityAuthMethod.KUBERNETES_AUTH]: revokeKubernetesAuth, - [IdentityAuthMethod.GCP_AUTH]: revokeGcpAuth, - [IdentityAuthMethod.TLS_CERT_AUTH]: revokeTlsCertAuth, - [IdentityAuthMethod.AWS_AUTH]: revokeAwsAuth, - [IdentityAuthMethod.AZURE_AUTH]: revokeAzureAuth, - [IdentityAuthMethod.ALICLOUD_AUTH]: revokeAliCloudAuth, - [IdentityAuthMethod.UNIVERSAL_AUTH]: revokeUniversalAuth, - [IdentityAuthMethod.TOKEN_AUTH]: revokeTokenAuth, - [IdentityAuthMethod.OCI_AUTH]: revokeOciAuth, - [IdentityAuthMethod.OIDC_AUTH]: revokeOidcAuth, - [IdentityAuthMethod.JWT_AUTH]: revokeJwtAuth, - [IdentityAuthMethod.LDAP_AUTH]: revokeLdapAuth - }; - - const handleDeleteAuthMethod = async (authMethod: IdentityAuthMethod) => { - await RemoveAuthMap[authMethod]({ - identityId: identity.id, - projectId: identity.projectId! - }); - - createNotification({ - text: "Successfully removed auth method", - type: "success" - }); - handlePopUpToggle("revokeAuthMethod", false); - }; - return ( <> @@ -194,16 +153,6 @@ export const ProjectIdentityAuthenticationSection = ({ identity, refetchIdentity text={(popUp.upgradePlan?.data as { description: string })?.description} isEnterpriseFeature={popUp.upgradePlan.data?.isEnterpriseFeature} /> - handlePopUpToggle("revokeAuthMethod", isOpen)} - deleteKey="confirm" - buttonText="Remove" - onDeleteApproved={() => - handleDeleteAuthMethod(popUp.revokeAuthMethod.data as IdentityAuthMethod) - } - /> ); };