added configuration to disable user sign up

This commit is contained in:
Miodec 2022-09-19 00:21:23 +02:00
parent 9e2d84da72
commit 526f391ffc
3 changed files with 12 additions and 0 deletions

View file

@ -89,6 +89,12 @@ router.get(
router.post(
"/signup",
validateConfiguration({
criteria: (configuration) => {
return configuration.users.signUp;
},
invalidMessage: "Sign up is temporarily disabled",
}),
authenticateRequest(),
RateLimit.userSignup,
validateRequest({

View file

@ -30,6 +30,7 @@ export const BASE_CONFIGURATION: MonkeyTypes.Configuration = {
apeKeySaltRounds: 5,
},
users: {
signUp: false,
discordIntegration: {
enabled: false,
},
@ -213,6 +214,10 @@ export const CONFIGURATION_FORM_SCHEMA: ObjectSchema = {
type: "object",
label: "Users",
fields: {
signUp: {
type: "boolean",
label: "Enabled",
},
xp: {
type: "object",
label: "XP",

View file

@ -29,6 +29,7 @@ declare namespace MonkeyTypes {
};
};
users: {
signUp: boolean;
autoBan: {
enabled: boolean;
maxCount: number;