mirror of
https://github.com/documenso/documenso.git
synced 2026-07-07 03:24:58 +10:00
138d663c25
Merge origin/main into feat/external-2fa-codes. Resolve formatting conflicts caused by biome rollout; preserve both feature streams: PR's external 2FA token + signing-session 2FA proof additions plus main's RateLimit/RecipientExpired/signingReminders/date-auto-insert. In complete-document-with-token.ts, drop the duplicate early field-fetching block introduced when main moved that logic later with date auto-insert support; keep the EXTERNAL_TWO_FACTOR_AUTH check using derivedRecipientActionAuth.
25 lines
641 B
TypeScript
25 lines
641 B
TypeScript
import { deleteTokenById } from '@documenso/lib/server-only/public-api/delete-api-token-by-id';
|
|
|
|
import { authenticatedProcedure } from '../trpc';
|
|
import { ZDeleteApiTokenRequestSchema, ZDeleteApiTokenResponseSchema } from './delete-api-token.types';
|
|
|
|
export const deleteApiTokenRoute = authenticatedProcedure
|
|
.input(ZDeleteApiTokenRequestSchema)
|
|
.output(ZDeleteApiTokenResponseSchema)
|
|
.mutation(async ({ input, ctx }) => {
|
|
const { id, teamId } = input;
|
|
|
|
ctx.logger.info({
|
|
input: {
|
|
id,
|
|
teamId,
|
|
},
|
|
});
|
|
|
|
await deleteTokenById({
|
|
id,
|
|
teamId,
|
|
userId: ctx.user.id,
|
|
});
|
|
});
|