add back user populate

This commit is contained in:
Maidul Islam
2023-04-10 13:45:49 -07:00
parent 8a67549ec5
commit 576381cd58
+2 -2
View File
@@ -157,7 +157,7 @@ const getAuthSTDPayload = async ({
}, { }, {
new: true new: true
}) })
.select('+encryptedKey +iv +tag'); .select('+encryptedKey +iv +tag').populate('user');
if (!serviceTokenData) throw ServiceTokenDataNotFoundError({ message: 'Failed to find service token data' }); if (!serviceTokenData) throw ServiceTokenDataNotFoundError({ message: 'Failed to find service token data' });
@@ -208,7 +208,7 @@ const getAuthAPIKeyPayload = async ({
let apiKeyData = await APIKeyData let apiKeyData = await APIKeyData
.findById(TOKEN_IDENTIFIER, '+secretHash +expiresAt') .findById(TOKEN_IDENTIFIER, '+secretHash +expiresAt')
.populate<{user: IUser}>('user', '+publicKey'); .populate<{ user: IUser }>('user', '+publicKey');
if (!apiKeyData) { if (!apiKeyData) {
throw APIKeyDataNotFoundError({ message: 'Failed to find API key data' }); throw APIKeyDataNotFoundError({ message: 'Failed to find API key data' });