mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 00:32:43 +10:00
fix: refactor auth router (#1983)
This commit is contained in:
18
packages/trpc/server/auth-router/find-passkeys.ts
Normal file
18
packages/trpc/server/auth-router/find-passkeys.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { findPasskeys } from '@documenso/lib/server-only/auth/find-passkeys';
|
||||
|
||||
import { authenticatedProcedure } from '../trpc';
|
||||
import { ZFindPasskeysRequestSchema, ZFindPasskeysResponseSchema } from './find-passkeys.types';
|
||||
|
||||
export const findPasskeysRoute = authenticatedProcedure
|
||||
.input(ZFindPasskeysRequestSchema)
|
||||
.output(ZFindPasskeysResponseSchema)
|
||||
.query(async ({ input, ctx }) => {
|
||||
const { page, perPage, orderBy } = input;
|
||||
|
||||
return await findPasskeys({
|
||||
page,
|
||||
perPage,
|
||||
orderBy,
|
||||
userId: ctx.user.id,
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user