mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 20:25:43 +00:00
feat: check if secret is expired before checking if secret has password
This commit is contained in:
@@ -2,7 +2,7 @@ import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
import { apiRequest } from "@app/config/request";
|
||||
|
||||
import { TSharedSecret, TViewSharedSecretResponse, ValidateSecretPassword } from "./types";
|
||||
import { TSharedSecret, TViewSharedSecretResponse } from "./types";
|
||||
|
||||
export const secretSharingKeys = {
|
||||
allSharedSecrets: () => ["sharedSecrets"] as const,
|
||||
@@ -77,7 +77,7 @@ export const fetchSecretIfPasswordIsValid = async (
|
||||
hashedHex: string,
|
||||
password: string,
|
||||
) => {
|
||||
const { data } = await apiRequest.post<ValidateSecretPassword>(
|
||||
const { data } = await apiRequest.post<TViewSharedSecretResponse>(
|
||||
`/api/v1/secret-sharing/public/${sharedSecretId}/validate`,
|
||||
{
|
||||
hashedHex,
|
||||
|
||||
@@ -31,7 +31,6 @@ export type TViewSharedSecretResponse = {
|
||||
tag: string;
|
||||
accessType: SecretSharingAccessType;
|
||||
orgName?: string;
|
||||
password?: string;
|
||||
};
|
||||
|
||||
export type TDeleteSharedSecretRequest = {
|
||||
@@ -41,8 +40,4 @@ export type TDeleteSharedSecretRequest = {
|
||||
export enum SecretSharingAccessType {
|
||||
Anyone = "anyone",
|
||||
Organization = "organization"
|
||||
}
|
||||
|
||||
export type ValidateSecretPassword = {
|
||||
isValid: boolean
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user