mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 11:29:42 +00:00
Changed "token" param to "hash" and used hex encoding for URL
This commit is contained in:
@@ -16,7 +16,7 @@ export const secretSharingKeys = {
|
||||
hashedHex: string | null;
|
||||
password?: string;
|
||||
email?: string;
|
||||
token?: string;
|
||||
hash?: string;
|
||||
}) => ["shared-secret", arg],
|
||||
getSecretRequestById: (arg: { id: string }) => ["secret-request", arg] as const
|
||||
};
|
||||
@@ -75,7 +75,7 @@ export const useGetActiveSharedSecretById = ({
|
||||
hashedHex,
|
||||
password,
|
||||
email,
|
||||
token
|
||||
hash
|
||||
}: {
|
||||
sharedSecretId: string;
|
||||
hashedHex: string | null;
|
||||
@@ -83,7 +83,7 @@ export const useGetActiveSharedSecretById = ({
|
||||
|
||||
// For secrets shared to specific emails (optional)
|
||||
email?: string;
|
||||
token?: string;
|
||||
hash?: string;
|
||||
}) => {
|
||||
return useQuery({
|
||||
queryKey: secretSharingKeys.getSecretById({
|
||||
@@ -91,7 +91,7 @@ export const useGetActiveSharedSecretById = ({
|
||||
hashedHex,
|
||||
password,
|
||||
email,
|
||||
token
|
||||
hash
|
||||
}),
|
||||
queryFn: async () => {
|
||||
const { data } = await apiRequest.post<TViewSharedSecretResponse>(
|
||||
@@ -100,7 +100,7 @@ export const useGetActiveSharedSecretById = ({
|
||||
...(hashedHex && { hashedHex }),
|
||||
password,
|
||||
email,
|
||||
token
|
||||
hash
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -42,9 +42,9 @@ export const ViewSharedSecretByIDPage = () => {
|
||||
from: ROUTE_PATHS.Public.ViewSharedSecretByIDPage.id,
|
||||
select: (el) => el.email
|
||||
});
|
||||
const token = useSearch({
|
||||
const hash = useSearch({
|
||||
from: ROUTE_PATHS.Public.ViewSharedSecretByIDPage.id,
|
||||
select: (el) => el.token
|
||||
select: (el) => el.hash
|
||||
});
|
||||
const [password, setPassword] = useState<string>();
|
||||
const { hashedHex, key } = extractDetailsFromUrl(urlEncodedKey);
|
||||
@@ -59,7 +59,7 @@ export const ViewSharedSecretByIDPage = () => {
|
||||
hashedHex,
|
||||
password,
|
||||
email,
|
||||
token
|
||||
hash
|
||||
});
|
||||
|
||||
const navigate = useNavigate();
|
||||
|
||||
@@ -9,7 +9,7 @@ import { ViewSharedSecretByIDPage } from "./ViewSharedSecretByIDPage";
|
||||
const SharedSecretByIDPageQuerySchema = z.object({
|
||||
key: z.string().catch(""),
|
||||
email: z.string().optional(),
|
||||
token: z.string().optional()
|
||||
hash: z.string().optional()
|
||||
});
|
||||
|
||||
export const Route = createFileRoute("/shared/secret/$secretId")({
|
||||
|
||||
Reference in New Issue
Block a user