mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-09 17:28:26 +00:00
refactor: simplify token retrieval by using findById method
This commit is contained in:
@@ -535,10 +535,7 @@ export const identityTokenAuthServiceFactory = ({
|
||||
});
|
||||
ForbiddenError.from(permission).throwUnlessCan(OrgPermissionIdentityActions.Read, OrgPermissionSubjects.Identity);
|
||||
|
||||
const token = await identityAccessTokenDAL.findOne({
|
||||
[`${TableName.IdentityAccessToken}.id` as "id"]: tokenId,
|
||||
[`${TableName.IdentityAccessToken}.authMethod` as "authMethod"]: IdentityAuthMethod.TOKEN_AUTH
|
||||
});
|
||||
const token = await identityAccessTokenDAL.findById(tokenId);
|
||||
|
||||
if (!token) throw new NotFoundError({ message: `Token with ID ${tokenId} not found` });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user