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