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