0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-02-17 22:04:19 -05:00

fix(core,console): show custom jwt error logs (#6749)

show custom jwt error logs
This commit is contained in:
simeng-li 2024-10-25 15:08:39 +08:00 committed by GitHub
parent af5c6c7f8e
commit a72e016b6d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 14 additions and 3 deletions

View file

@ -106,6 +106,8 @@ export const auditLogEventTitle: Record<string, Optional<string>> & {
'Verify forgot-password SMS verification code',
'Interaction.SignIn.Verification.IdpInitiatedSso.Create':
'Create IdP-initiated SAML SSO authentication session',
'JwtCustomizer.AccessToken': 'Get custom user access token claims',
'JwtCustomizer.ClientCredential': 'Get custom M2M access token claims',
});
export const logEventTitle: Record<string, Optional<string>> & {

View file

@ -6,6 +6,7 @@ import {
type Log,
type interaction,
type LogKeyUnknown,
type jwtCustomizer,
} from '@logto/schemas';
import { conditional, conditionalArray } from '@silverhand/essentials';
import { sql } from '@silverhand/slonik';
@ -18,7 +19,12 @@ import { conditionalSql, convertToIdentifiers } from '#src/utils/sql.js';
const { table, fields } = convertToIdentifiers(Logs);
export type AllowedKeyPrefix = hook.Type | token.Type | interaction.Prefix | typeof LogKeyUnknown;
export type AllowedKeyPrefix =
| hook.Type
| token.Type
| interaction.Prefix
| jwtCustomizer.Prefix
| typeof LogKeyUnknown;
type LogCondition = {
logKey?: string;

View file

@ -1,4 +1,4 @@
import { LogResult, token, interaction, LogKeyUnknown } from '@logto/schemas';
import { LogResult, token, interaction, LogKeyUnknown, jwtCustomizer } from '@logto/schemas';
import type { Log } from '@logto/schemas';
import { pickDefault } from '@logto/shared/esm';
@ -49,6 +49,7 @@ describe('logRoutes', () => {
token.Type.ExchangeTokenBy,
token.Type.RevokeToken,
interaction.prefix,
jwtCustomizer.prefix,
LogKeyUnknown,
],
});
@ -59,6 +60,7 @@ describe('logRoutes', () => {
token.Type.ExchangeTokenBy,
token.Type.RevokeToken,
interaction.prefix,
jwtCustomizer.prefix,
LogKeyUnknown,
],
});

View file

@ -1,4 +1,4 @@
import { Logs, interaction, token, LogKeyUnknown } from '@logto/schemas';
import { Logs, interaction, token, LogKeyUnknown, jwtCustomizer } from '@logto/schemas';
import { object, string } from 'zod';
import koaGuard from '#src/middleware/koa-guard.js';
@ -34,6 +34,7 @@ export default function logRoutes<T extends ManagementApiRouter>(
token.Type.ExchangeTokenBy,
token.Type.RevokeToken,
interaction.prefix,
jwtCustomizer.prefix,
LogKeyUnknown,
];