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,16 @@
import { createPasskeyRegistrationOptions } from '@documenso/lib/server-only/auth/create-passkey-registration-options';
import { authenticatedProcedure } from '../trpc';
import {
ZCreatePasskeyRegistrationOptionsRequestSchema,
ZCreatePasskeyRegistrationOptionsResponseSchema,
} from './create-passkey-registration-options.types';
export const createPasskeyRegistrationOptionsRoute = authenticatedProcedure
.input(ZCreatePasskeyRegistrationOptionsRequestSchema)
.output(ZCreatePasskeyRegistrationOptionsResponseSchema)
.mutation(async ({ ctx }) => {
return await createPasskeyRegistrationOptions({
userId: ctx.user.id,
});
});