Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Greptile review fixes

x032205bceddab89f81
diff --git a/backend/src/lib/api-docs/constants.ts b/backend/src/lib/api-docs/constants.ts
index 80a7177536..f520d87da2 100644
--- a/backend/src/lib/api-docs/constants.ts
+++ b/backend/src/lib/api-docs/constants.ts
@@ -209,6 +209,9 @@ export const UNIVERSAL_AUTH = {
identityId: "The ID of the identity to revoke the client secret from.",
clientSecretId: "The ID of the client secret to revoke."
},
+ CLEAR_CLIENT_LOCKOUTS: {
+ identityId: "The ID of the identity to clear the client lockouts from."
+ },
RENEW_ACCESS_TOKEN: {
accessToken: "The access token to renew."
},
diff --git a/backend/src/server/routes/v1/identity-universal-auth-router.ts b/backend/src/server/routes/v1/identity-universal-auth-router.ts
index f0fefb4d85..a3d332e0c7 100644
--- a/backend/src/server/routes/v1/identity-universal-auth-router.ts
+++ b/backend/src/server/routes/v1/identity-universal-auth-router.ts
@@ -638,7 +638,7 @@ export const registerIdentityUaRouter = async (server: FastifyZodProvider) => {
}
],
params: z.object({
- identityId: z.string().describe(UNIVERSAL_AUTH.REVOKE_CLIENT_SECRET.identityId)
+ identityId: z.string().describe(UNIVERSAL_AUTH.CLEAR_CLIENT_LOCKOUTS.identityId)
}),
response: {
200: z.object({
diff --git a/frontend/src/hooks/api/identities/mutations.tsx b/frontend/src/hooks/api/identities/mutations.tsx
index f3194a7447..ca903bb486 100644
--- a/frontend/src/hooks/api/identities/mutations.tsx
+++ b/frontend/src/hooks/api/identities/mutations.tsx
@@ -305,7 +305,7 @@ export const useClearIdentityUniversalAuthLockouts = () => {
},
onSuccess: (_, { identityId }) => {
queryClient.invalidateQueries({
- queryKey: identitiesKeys.clearIdentityUniversalAuthLockouts(identityId)
+ queryKey: identitiesKeys.getIdentityUniversalAuth(identityId)
});
}
});
diff --git a/frontend/src/hooks/api/identities/queries.tsx b/frontend/src/hooks/api/identities/queries.tsx
index ba81a97f15..cf7f4be87e 100644
--- a/frontend/src/hooks/api/identities/queries.tsx
+++ b/frontend/src/hooks/api/identities/queries.tsx
@@ -49,9 +49,7 @@ export const identitiesKeys = {
getIdentityTokensTokenAuth: (identityId: string) =>
[{ identityId }, "identity-tokens-token-auth"] as const,
getIdentityProjectMemberships: (identityId: string) =>
- [{ identityId }, "identity-project-memberships"] as const,
- clearIdentityUniversalAuthLockouts: (identityId: string) =>
- [{ identityId }, "clear-identity-universal-auth-lockouts"] as const
+ [{ identityId }, "identity-project-memberships"] as const
};
export const useGetIdentityById = (identityId: string) => {
diff --git a/frontend/src/pages/organization/IdentityDetailsByIDPage/components/ViewIdentityAuthModal/ViewIdentityUniversalAuthContent.tsx b/frontend/src/pages/organization/IdentityDetailsByIDPage/components/ViewIdentityAuthModal/ViewIdentityUniversalAuthContent.tsx
index 7ea5858a7b..c2a1df6b9b 100644
--- a/frontend/src/pages/organization/IdentityDetailsByIDPage/components/ViewIdentityAuthModal/ViewIdentityUniversalAuthContent.tsx
+++ b/frontend/src/pages/organization/IdentityDetailsByIDPage/components/ViewIdentityAuthModal/ViewIdentityUniversalAuthContent.tsx
@@ -40,14 +40,20 @@ export const ViewIdentityUniversalAuthContent = ({
});
async function clearLockouts() {
- const deleted = await clearLockoutsFn({ identityId });
-
- createNotification({
- text: `Successfully cleared ${deleted} lockout${deleted === 1 ? "" : "s"}`,
- type: "success"
- });
-
- setLockedOutState(false);
+ try {
+ const deleted = await clearLockoutsFn({ identityId });
+ createNotification({
+ text: `Successfully cleared ${deleted} lockout${deleted === 1 ? "" : "s"}`,
+ type: "success"
+ });
+ setLockedOutState(false);
+ } catch (error) {
+ console.error(error);
+ createNotification({
+ text: "Failed to clear lockouts. Please try again.",
+ type: "error"
+ });
+ }
}
if (isPending || clientSecretsPending) {