Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
1.3 kB ยท 48 lines
TypeScript
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849import { CreateSsoPortalLinkInput, createSsoPortalLink, disableSso, enableSso, getSsoConfig,} from "@openstatus/services/sso";
import { toServiceCtx, toTRPCError } from "../service-adapter";import { createTRPCRouter, protectedProcedure } from "../trpc";
export const ssoRouter = createTRPCRouter({ get: protectedProcedure.query(async ({ ctx }) => { try { return await getSsoConfig({ ctx: toServiceCtx(ctx) }); } catch (err) { toTRPCError(err); } }),
enable: protectedProcedure.mutation(async ({ ctx }) => { try { return await enableSso({ ctx: toServiceCtx(ctx) }); } catch (err) { toTRPCError(err); } }),
disable: protectedProcedure.mutation(async ({ ctx }) => { try { await disableSso({ ctx: toServiceCtx(ctx) }); } catch (err) { toTRPCError(err); } }),
// A mutation rather than a query: portal links expire five minutes after // creation, so they must not be prefetched or cached. portalLink: protectedProcedure .input(CreateSsoPortalLinkInput) .mutation(async ({ ctx, input }) => { try { return await createSsoPortalLink({ ctx: toServiceCtx(ctx), input }); } catch (err) { toTRPCError(err); } }),});