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:
parent
af5c6c7f8e
commit
a72e016b6d
4 changed files with 14 additions and 3 deletions
|
@ -106,6 +106,8 @@ export const auditLogEventTitle: Record<string, Optional<string>> & {
|
||||||
'Verify forgot-password SMS verification code',
|
'Verify forgot-password SMS verification code',
|
||||||
'Interaction.SignIn.Verification.IdpInitiatedSso.Create':
|
'Interaction.SignIn.Verification.IdpInitiatedSso.Create':
|
||||||
'Create IdP-initiated SAML SSO authentication session',
|
'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>> & {
|
export const logEventTitle: Record<string, Optional<string>> & {
|
||||||
|
|
|
@ -6,6 +6,7 @@ import {
|
||||||
type Log,
|
type Log,
|
||||||
type interaction,
|
type interaction,
|
||||||
type LogKeyUnknown,
|
type LogKeyUnknown,
|
||||||
|
type jwtCustomizer,
|
||||||
} from '@logto/schemas';
|
} from '@logto/schemas';
|
||||||
import { conditional, conditionalArray } from '@silverhand/essentials';
|
import { conditional, conditionalArray } from '@silverhand/essentials';
|
||||||
import { sql } from '@silverhand/slonik';
|
import { sql } from '@silverhand/slonik';
|
||||||
|
@ -18,7 +19,12 @@ import { conditionalSql, convertToIdentifiers } from '#src/utils/sql.js';
|
||||||
|
|
||||||
const { table, fields } = convertToIdentifiers(Logs);
|
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 = {
|
type LogCondition = {
|
||||||
logKey?: string;
|
logKey?: string;
|
||||||
|
|
|
@ -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 type { Log } from '@logto/schemas';
|
||||||
import { pickDefault } from '@logto/shared/esm';
|
import { pickDefault } from '@logto/shared/esm';
|
||||||
|
|
||||||
|
@ -49,6 +49,7 @@ describe('logRoutes', () => {
|
||||||
token.Type.ExchangeTokenBy,
|
token.Type.ExchangeTokenBy,
|
||||||
token.Type.RevokeToken,
|
token.Type.RevokeToken,
|
||||||
interaction.prefix,
|
interaction.prefix,
|
||||||
|
jwtCustomizer.prefix,
|
||||||
LogKeyUnknown,
|
LogKeyUnknown,
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
@ -59,6 +60,7 @@ describe('logRoutes', () => {
|
||||||
token.Type.ExchangeTokenBy,
|
token.Type.ExchangeTokenBy,
|
||||||
token.Type.RevokeToken,
|
token.Type.RevokeToken,
|
||||||
interaction.prefix,
|
interaction.prefix,
|
||||||
|
jwtCustomizer.prefix,
|
||||||
LogKeyUnknown,
|
LogKeyUnknown,
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
|
@ -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 { object, string } from 'zod';
|
||||||
|
|
||||||
import koaGuard from '#src/middleware/koa-guard.js';
|
import koaGuard from '#src/middleware/koa-guard.js';
|
||||||
|
@ -34,6 +34,7 @@ export default function logRoutes<T extends ManagementApiRouter>(
|
||||||
token.Type.ExchangeTokenBy,
|
token.Type.ExchangeTokenBy,
|
||||||
token.Type.RevokeToken,
|
token.Type.RevokeToken,
|
||||||
interaction.prefix,
|
interaction.prefix,
|
||||||
|
jwtCustomizer.prefix,
|
||||||
LogKeyUnknown,
|
LogKeyUnknown,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue