aboutsummaryrefslogtreecommitdiffstats
path: root/packages/trpc
diff options
context:
space:
mode:
Diffstat (limited to 'packages/trpc')
-rw-r--r--packages/trpc/routers/users.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/packages/trpc/routers/users.ts b/packages/trpc/routers/users.ts
index ba1aee24..736e7e2f 100644
--- a/packages/trpc/routers/users.ts
+++ b/packages/trpc/routers/users.ts
@@ -29,10 +29,16 @@ export const usersAppRouter = router({
}),
)
.mutation(async ({ input, ctx }) => {
- if (serverConfig.auth.disableSignups) {
+ if (
+ serverConfig.auth.disableSignups ||
+ serverConfig.auth.disablePasswordSignups
+ ) {
+ const errorMessage = serverConfig.auth.disablePasswordSignups
+ ? "Local Signups are disabled in the server config. Use OAuth instead!"
+ : "Signups are disabled in server config";
throw new TRPCError({
code: "FORBIDDEN",
- message: "Signups are disabled in server config",
+ message: errorMessage,
});
}
// TODO: This is racy, but that's probably fine.