feat: added identity access token to project identity router

This commit is contained in:
=
2025-11-10 14:41:06 +05:30
parent 32cd5fd466
commit 1ef39f6961
2 changed files with 7 additions and 7 deletions

View File

@@ -40,7 +40,7 @@ export const registerProjectIdentityRouter = async (server: FastifyZodProvider)
config: {
rateLimit: writeLimit
},
onRequest: verifyAuth([AuthMode.JWT]),
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
schema: {
tags: [ApiDocsTags.Identities],
description: "Create an identity in a project",
@@ -102,7 +102,7 @@ export const registerProjectIdentityRouter = async (server: FastifyZodProvider)
config: {
rateLimit: writeLimit
},
onRequest: verifyAuth([AuthMode.JWT]),
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
schema: {
tags: [ApiDocsTags.Identities],
description: "Update an identity in a project",
@@ -168,7 +168,7 @@ export const registerProjectIdentityRouter = async (server: FastifyZodProvider)
config: {
rateLimit: writeLimit
},
onRequest: verifyAuth([AuthMode.JWT]),
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
schema: {
tags: [ApiDocsTags.Identities],
description: "Delete an identity from a project",
@@ -221,7 +221,7 @@ export const registerProjectIdentityRouter = async (server: FastifyZodProvider)
config: {
rateLimit: readLimit
},
onRequest: verifyAuth([AuthMode.JWT]),
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
schema: {
tags: [ApiDocsTags.Identities],
description: "Get an identity by ID in a project",
@@ -263,7 +263,7 @@ export const registerProjectIdentityRouter = async (server: FastifyZodProvider)
config: {
rateLimit: readLimit
},
onRequest: verifyAuth([AuthMode.JWT]),
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
schema: {
tags: [ApiDocsTags.Identities],
description: "List identities in a project",

View File

@@ -227,7 +227,7 @@ export const identityAccessTokenServiceFactory = ({
});
if (!identityOrgMembership) {
throw new BadRequestError({ message: "Identity does not belong to any organization" });
throw new BadRequestError({ message: "Identity does not belong to this organization" });
}
orgId = subOrganization.id;
orgName = subOrganization.name;
@@ -241,7 +241,7 @@ export const identityAccessTokenServiceFactory = ({
});
if (!identityOrgMembership) {
throw new BadRequestError({ message: "Identity does not belong to any organization" });
throw new BadRequestError({ message: "Identity does not belong to this organization" });
}
orgId = identityOrgDetails.id;