Files
calendar/packages/trpc/server/routers/viewer/oAuth/getClient.handler.ts
T
5fe3714edd feat: auto skip consent screen for trusted oauth clients (#25640)
* auto constent for trusted clients

* add loading state

---------

Co-authored-by: CarinaWolli <wollencarina@gmail.com>
2025-12-17 13:00:12 +00:00

26 lines
518 B
TypeScript

import { prisma } from "@calcom/prisma";
import type { TGetClientInputSchema } from "./getClient.schema";
type GetClientOptions = {
input: TGetClientInputSchema;
};
export const getClientHandler = async ({ input }: GetClientOptions) => {
const { clientId } = input;
const client = await prisma.oAuthClient.findUnique({
where: {
clientId,
},
select: {
clientId: true,
redirectUri: true,
name: true,
logo: true,
isTrusted: true,
},
});
return client;
};