mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-09 13:44:29 +08:00
added configuration to disable user sign up
This commit is contained in:
parent
9e2d84da72
commit
526f391ffc
3 changed files with 12 additions and 0 deletions
|
|
@ -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({
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
1
backend/src/types/types.d.ts
vendored
1
backend/src/types/types.d.ts
vendored
|
|
@ -29,6 +29,7 @@ declare namespace MonkeyTypes {
|
|||
};
|
||||
};
|
||||
users: {
|
||||
signUp: boolean;
|
||||
autoBan: {
|
||||
enabled: boolean;
|
||||
maxCount: number;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue