Merge branch 'Infisical:main' into main

This commit is contained in:
Reginald
2022-12-12 18:15:13 +01:00
committed by GitHub
9 changed files with 120 additions and 94 deletions

View File

@@ -309,7 +309,7 @@ export const getBackupPrivateKey = async (req: Request, res: Response) => {
try {
backupPrivateKey = await BackupPrivateKey.findOne({
user: req.user._id
});
}).select('+encryptedPrivateKey +iv +tag');
if (!backupPrivateKey) throw new Error('Failed to find backup private key');
} catch (err) {