13 lines
304 B
TypeScript
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",
|
|
});
|
|
}
|
|
};
|