Files
Homarr/packages/api/src/router/invite/checks.ts

13 lines
304 B
TypeScript

import { TRPCError } from "@trpc/server";
import { env } from "@homarr/auth/env";
export const throwIfCredentialsDisabled = () => {
if (!env.AUTH_PROVIDERS.includes("credentials")) {
throw new TRPCError({
code: "FORBIDDEN",
message: "Credentials provider is disabled",
});
}
};