mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-09 07:28:21 +00:00
fix: identityAccessTokenDALFactory.findOne dal function
This commit is contained in:
@@ -18,7 +18,6 @@ export const identityAccessTokenDALFactory = (db: TDbClient) => {
|
||||
.where(filter)
|
||||
.join(TableName.Identity, `${TableName.Identity}.id`, `${TableName.IdentityAccessToken}.identityId`)
|
||||
.select(selectAllTableCols(TableName.IdentityAccessToken))
|
||||
.select(db.ref("name").withSchema(TableName.Identity))
|
||||
.select(db.ref("orgId").withSchema(TableName.Identity).as("identityScopeOrgId"))
|
||||
.first();
|
||||
|
||||
|
||||
@@ -535,7 +535,11 @@ export const identityTokenAuthServiceFactory = ({
|
||||
});
|
||||
ForbiddenError.from(permission).throwUnlessCan(OrgPermissionIdentityActions.Read, OrgPermissionSubjects.Identity);
|
||||
|
||||
const token = await identityAccessTokenDAL.findById(tokenId);
|
||||
const token = await identityAccessTokenDAL.findOne({
|
||||
[`${TableName.IdentityAccessToken}.id` as "id"]: tokenId,
|
||||
[`${TableName.IdentityAccessToken}.authMethod` as "authMethod"]: IdentityAuthMethod.TOKEN_AUTH,
|
||||
[`${TableName.IdentityAccessToken}.identityId` as "identityId"]: identityId
|
||||
});
|
||||
|
||||
if (!token) throw new NotFoundError({ message: `Token with ID ${tokenId} not found` });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user