mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 14:26:38 +00:00
Merge pull request #834 from akhilmhdh/fix/copy-sec-not-populating
fix: secret path / with a new env causes secret list to be empty
This commit is contained in:
@@ -785,10 +785,16 @@ export const getSecrets = async (req: Request, res: Response) => {
|
|||||||
const environment = req.query.environment as string;
|
const environment = req.query.environment as string;
|
||||||
|
|
||||||
const folders = await Folder.findOne({ workspace: workspaceId, environment });
|
const folders = await Folder.findOne({ workspace: workspaceId, environment });
|
||||||
if ((!folders && folderId && folderId !== "root") || (!folders && secretPath)) {
|
|
||||||
|
if (
|
||||||
|
// if no folders and asking for a non root folder id or non root secret path
|
||||||
|
(!folders && folderId && folderId !== "root") ||
|
||||||
|
(!folders && secretPath && secretPath !== "/")
|
||||||
|
) {
|
||||||
res.send({ secrets: [] });
|
res.send({ secrets: [] });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (folders && folderId !== "root") {
|
if (folders && folderId !== "root") {
|
||||||
const folder = searchByFolderId(folders.nodes, folderId as string);
|
const folder = searchByFolderId(folders.nodes, folderId as string);
|
||||||
if (!folder) {
|
if (!folder) {
|
||||||
|
|||||||
@@ -115,7 +115,9 @@ export const SecretDropzone = ({
|
|||||||
workspaceId,
|
workspaceId,
|
||||||
env: selectedEnvSlug,
|
env: selectedEnvSlug,
|
||||||
secretPath: debouncedSecretPath,
|
secretPath: debouncedSecretPath,
|
||||||
isPaused: !(Boolean(workspaceId) && Boolean(selectedEnvSlug) && Boolean(debouncedSecretPath)),
|
isPaused:
|
||||||
|
!(Boolean(workspaceId) && Boolean(selectedEnvSlug) && Boolean(debouncedSecretPath)) &&
|
||||||
|
!popUp.importSecEnv.isOpen,
|
||||||
decryptFileKey
|
decryptFileKey
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user