From e364e31e25bd1d4b8d801c845a96d6be708f0a18 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 19 Jan 2023 09:27:16 +0100 Subject: Implement signup approval in server --- shared/models/server/custom-config.model.ts | 1 + shared/models/server/server-config.model.ts | 1 + shared/models/server/server-error-code.enum.ts | 10 ++++++++-- 3 files changed, 10 insertions(+), 2 deletions(-) (limited to 'shared/models/server') diff --git a/shared/models/server/custom-config.model.ts b/shared/models/server/custom-config.model.ts index 7d9d570b1..846bf6159 100644 --- a/shared/models/server/custom-config.model.ts +++ b/shared/models/server/custom-config.model.ts @@ -83,6 +83,7 @@ export interface CustomConfig { signup: { enabled: boolean limit: number + requiresApproval: boolean requiresEmailVerification: boolean minimumAge: number } diff --git a/shared/models/server/server-config.model.ts b/shared/models/server/server-config.model.ts index 3b6d0597c..d0bd9a00f 100644 --- a/shared/models/server/server-config.model.ts +++ b/shared/models/server/server-config.model.ts @@ -131,6 +131,7 @@ export interface ServerConfig { allowed: boolean allowedForCurrentIP: boolean requiresEmailVerification: boolean + requiresApproval: boolean minimumAge: number } diff --git a/shared/models/server/server-error-code.enum.ts b/shared/models/server/server-error-code.enum.ts index 0e70ea0a7..a39cde1b3 100644 --- a/shared/models/server/server-error-code.enum.ts +++ b/shared/models/server/server-error-code.enum.ts @@ -39,7 +39,13 @@ export const enum ServerErrorCode { */ INCORRECT_FILES_IN_TORRENT = 'incorrect_files_in_torrent', - COMMENT_NOT_ASSOCIATED_TO_VIDEO = 'comment_not_associated_to_video' + COMMENT_NOT_ASSOCIATED_TO_VIDEO = 'comment_not_associated_to_video', + + MISSING_TWO_FACTOR = 'missing_two_factor', + INVALID_TWO_FACTOR = 'invalid_two_factor', + + ACCOUNT_WAITING_FOR_APPROVAL = 'account_waiting_for_approval', + ACCOUNT_APPROVAL_REJECTED = 'account_approval_rejected' } /** @@ -70,5 +76,5 @@ export const enum OAuth2ErrorCode { * * @see https://github.com/oauthjs/node-oauth2-server/blob/master/lib/errors/invalid-token-error.js */ - INVALID_TOKEN = 'invalid_token', + INVALID_TOKEN = 'invalid_token' } -- cgit v1.2.3