feat: add identityName to audit log event and enhance identity token response structure

This commit is contained in:
Piyush Gupta
2025-11-17 20:48:57 +05:30
parent 0fe8dc1917
commit 7d6f52d2ae
2 changed files with 8 additions and 0 deletions

View File

@@ -1034,6 +1034,7 @@ interface GetTokenIdentityTokenAuthEvent {
type: EventType.GET_TOKEN_IDENTITY_TOKEN_AUTH;
metadata: {
identityId: string;
identityName: string;
tokenId: string;
};
}

View File

@@ -312,6 +312,9 @@ export const registerIdentityTokenAuthRouter = async (server: FastifyZodProvider
response: {
200: z.object({
accessToken: z.string(),
expiresIn: z.coerce.number(),
accessTokenMaxTTL: z.coerce.number(),
tokenType: z.literal("Bearer"),
tokenData: IdentityAccessTokensSchema
})
}
@@ -342,6 +345,9 @@ export const registerIdentityTokenAuthRouter = async (server: FastifyZodProvider
return {
accessToken,
tokenType: "Bearer" as const,
expiresIn: identityTokenAuth.accessTokenTTL,
accessTokenMaxTTL: identityTokenAuth.accessTokenMaxTTL,
tokenData: identityAccessToken
};
}
@@ -446,6 +452,7 @@ export const registerIdentityTokenAuthRouter = async (server: FastifyZodProvider
type: EventType.GET_TOKEN_IDENTITY_TOKEN_AUTH,
metadata: {
identityId: token.identityId,
identityName: identityMembershipOrg.identity.name,
tokenId: token.id
}
}