0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

refactor: cleanup

This commit is contained in:
Gao Sun 2022-12-22 13:53:28 +08:00 committed by simeng-li
parent 464a4a9133
commit a6342213a9
No known key found for this signature in database
GPG key ID: 14EA7BB1541E8075
3 changed files with 1 additions and 6 deletions

View file

@ -1,6 +1,5 @@
import { getUnixTime } from 'date-fns';
import type { Context } from 'koa';
import type { IRouterParamContext } from 'koa-router';
import type { InteractionResults, Provider } from 'oidc-provider';
import { errors } from 'oidc-provider';
@ -36,7 +35,7 @@ export const assignInteractionResults = async (
};
export const checkSessionHealth = async (
ctx: IRouterParamContext & Context,
ctx: Context,
provider: Provider,
tolerance = 10 * 60 // 10 mins
) => {

View file

@ -42,7 +42,6 @@ export type LogPayload = Partial<LogContextPayload> & Record<string, unknown>;
export type LogContext = {
createLog: (key: LogKey) => LogEntry;
getLogs: () => readonly LogEntry[];
prependAllLogEntries: (payload: LogPayload) => void;
};
@ -110,8 +109,6 @@ export default function koaAuditLog<
return entry;
};
ctx.getLogs = () => Object.freeze(entries);
ctx.prependAllLogEntries = (payload) => {
for (const entry of entries) {
entry.prepend(payload);

View file

@ -13,7 +13,6 @@ export const createMockLogContext = (): LogContext & { mockAppend: jest.Mock } =
return {
createLog: jest.fn(() => mockLogEntry),
prependAllLogEntries: jest.fn(),
getLogs: jest.fn(),
mockAppend: mockLogEntry.append,
};
};