mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 18:27:36 +00:00
Greptile review fixes
This commit is contained in:
@@ -209,6 +209,9 @@ export const UNIVERSAL_AUTH = {
|
|||||||
identityId: "The ID of the identity to revoke the client secret from.",
|
identityId: "The ID of the identity to revoke the client secret from.",
|
||||||
clientSecretId: "The ID of the client secret to revoke."
|
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: {
|
RENEW_ACCESS_TOKEN: {
|
||||||
accessToken: "The access token to renew."
|
accessToken: "The access token to renew."
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -638,7 +638,7 @@ export const registerIdentityUaRouter = async (server: FastifyZodProvider) => {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
params: z.object({
|
params: z.object({
|
||||||
identityId: z.string().describe(UNIVERSAL_AUTH.REVOKE_CLIENT_SECRET.identityId)
|
identityId: z.string().describe(UNIVERSAL_AUTH.CLEAR_CLIENT_LOCKOUTS.identityId)
|
||||||
}),
|
}),
|
||||||
response: {
|
response: {
|
||||||
200: z.object({
|
200: z.object({
|
||||||
|
|||||||
@@ -305,7 +305,7 @@ export const useClearIdentityUniversalAuthLockouts = () => {
|
|||||||
},
|
},
|
||||||
onSuccess: (_, { identityId }) => {
|
onSuccess: (_, { identityId }) => {
|
||||||
queryClient.invalidateQueries({
|
queryClient.invalidateQueries({
|
||||||
queryKey: identitiesKeys.clearIdentityUniversalAuthLockouts(identityId)
|
queryKey: identitiesKeys.getIdentityUniversalAuth(identityId)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -49,9 +49,7 @@ export const identitiesKeys = {
|
|||||||
getIdentityTokensTokenAuth: (identityId: string) =>
|
getIdentityTokensTokenAuth: (identityId: string) =>
|
||||||
[{ identityId }, "identity-tokens-token-auth"] as const,
|
[{ identityId }, "identity-tokens-token-auth"] as const,
|
||||||
getIdentityProjectMemberships: (identityId: string) =>
|
getIdentityProjectMemberships: (identityId: string) =>
|
||||||
[{ identityId }, "identity-project-memberships"] as const,
|
[{ identityId }, "identity-project-memberships"] as const
|
||||||
clearIdentityUniversalAuthLockouts: (identityId: string) =>
|
|
||||||
[{ identityId }, "clear-identity-universal-auth-lockouts"] as const
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const useGetIdentityById = (identityId: string) => {
|
export const useGetIdentityById = (identityId: string) => {
|
||||||
|
|||||||
+14
-8
@@ -40,14 +40,20 @@ export const ViewIdentityUniversalAuthContent = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
async function clearLockouts() {
|
async function clearLockouts() {
|
||||||
const deleted = await clearLockoutsFn({ identityId });
|
try {
|
||||||
|
const deleted = await clearLockoutsFn({ identityId });
|
||||||
createNotification({
|
createNotification({
|
||||||
text: `Successfully cleared ${deleted} lockout${deleted === 1 ? "" : "s"}`,
|
text: `Successfully cleared ${deleted} lockout${deleted === 1 ? "" : "s"}`,
|
||||||
type: "success"
|
type: "success"
|
||||||
});
|
});
|
||||||
|
setLockedOutState(false);
|
||||||
setLockedOutState(false);
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
createNotification({
|
||||||
|
text: "Failed to clear lockouts. Please try again.",
|
||||||
|
type: "error"
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isPending || clientSecretsPending) {
|
if (isPending || clientSecretsPending) {
|
||||||
|
|||||||
Reference in New Issue
Block a user