Add required backup key return fields for GET backup key

This commit is contained in:
Tuan Dang
2022-12-12 08:31:20 -05:00
parent 95a1e9560e
commit 6f90064400

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) {