fix: refactor auth router (#1983)

This commit is contained in:
David Nguyen
2025-08-25 08:24:32 +10:00
committed by GitHub
parent 5a5bfe6e34
commit 49fabeb0ec
22 changed files with 280 additions and 167 deletions

View 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,
});
});