mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-03 22:26:07 +00:00
Populate service token user
This commit is contained in:
@@ -148,7 +148,7 @@ const getAuthSTDPayload = async ({
|
|||||||
|
|
||||||
serviceTokenData = await ServiceTokenData
|
serviceTokenData = await ServiceTokenData
|
||||||
.findById(TOKEN_IDENTIFIER)
|
.findById(TOKEN_IDENTIFIER)
|
||||||
.select('+encryptedKey +iv +tag');
|
.select('+encryptedKey +iv +tag').populate('user');
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw UnauthorizedRequestError({
|
throw UnauthorizedRequestError({
|
||||||
|
|||||||
@@ -17,10 +17,10 @@ const requireServiceTokenDataAuth = ({
|
|||||||
|
|
||||||
const serviceTokenData = await ServiceTokenData
|
const serviceTokenData = await ServiceTokenData
|
||||||
.findById(req[location].serviceTokenDataId)
|
.findById(req[location].serviceTokenDataId)
|
||||||
.select('+encryptedKey +iv +tag');
|
.select('+encryptedKey +iv +tag').populate('user');
|
||||||
|
|
||||||
if (!serviceTokenData) {
|
if (!serviceTokenData) {
|
||||||
return next(AccountNotFoundError({message: 'Failed to locate service token data'}));
|
return next(AccountNotFoundError({ message: 'Failed to locate service token data' }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (req.user) {
|
if (req.user) {
|
||||||
|
|||||||
Reference in New Issue
Block a user