Skip to content

Commit 923ae1e

Browse files
authored
Merge pull request #17 from 413n/feat/add-path-to-fingerprint
2 parents 2dfaa3a + 33a84b6 commit 923ae1e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/core/src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ export const defineTRPCLimiter = <
4646
) => {
4747
const options = parseOptions(opts as any, getDefaultOptions)
4848
const store = adapter.store(options as any)
49-
const middleware: MwFn<TRoot> = async ({ ctx, next, input }) => {
50-
const fp = await options.fingerprint(ctx, input)
49+
const middleware: MwFn<TRoot> = async ({ ctx, next, input, path }) => {
50+
const fp = await options.fingerprint(ctx, input, path)
5151
if (!fp) {
5252
throw new TRPCError({
5353
code: 'INTERNAL_SERVER_ERROR',

packages/core/src/types.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ export type BaseOpts<TRoot extends AnyRootConfig, Res> = {
4040
**/
4141
fingerprint: (
4242
ctx: TRoot['_config']['$types']['ctx'],
43-
input: any
43+
input: any,
44+
path: string
4445
) => string | Promise<string>
4546
}
4647

0 commit comments

Comments
 (0)