diff options
author | Chocobozzz <me@florianbigard.com> | 2023-01-19 09:27:16 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2023-01-19 13:53:40 +0100 |
commit | e364e31e25bd1d4b8d801c845a96d6be708f0a18 (patch) | |
tree | 220785a42af361706eb8243960c5da9cddf4d2be /shared/models/users/registration | |
parent | bc48e33b80f357767b98c1d310b04bdda24c6d46 (diff) | |
download | PeerTube-e364e31e25bd1d4b8d801c845a96d6be708f0a18.tar.gz PeerTube-e364e31e25bd1d4b8d801c845a96d6be708f0a18.tar.zst PeerTube-e364e31e25bd1d4b8d801c845a96d6be708f0a18.zip |
Implement signup approval in server
Diffstat (limited to 'shared/models/users/registration')
6 files changed, 59 insertions, 0 deletions
diff --git a/shared/models/users/registration/index.ts b/shared/models/users/registration/index.ts new file mode 100644 index 000000000..593740c4f --- /dev/null +++ b/shared/models/users/registration/index.ts | |||
@@ -0,0 +1,5 @@ | |||
1 | export * from './user-register.model' | ||
2 | export * from './user-registration-request.model' | ||
3 | export * from './user-registration-state.model' | ||
4 | export * from './user-registration-update-state.model' | ||
5 | export * from './user-registration.model' | ||
diff --git a/shared/models/users/registration/user-register.model.ts b/shared/models/users/registration/user-register.model.ts new file mode 100644 index 000000000..cf9a43a67 --- /dev/null +++ b/shared/models/users/registration/user-register.model.ts | |||
@@ -0,0 +1,12 @@ | |||
1 | export interface UserRegister { | ||
2 | username: string | ||
3 | password: string | ||
4 | email: string | ||
5 | |||
6 | displayName?: string | ||
7 | |||
8 | channel?: { | ||
9 | name: string | ||
10 | displayName: string | ||
11 | } | ||
12 | } | ||
diff --git a/shared/models/users/registration/user-registration-request.model.ts b/shared/models/users/registration/user-registration-request.model.ts new file mode 100644 index 000000000..6c38817e0 --- /dev/null +++ b/shared/models/users/registration/user-registration-request.model.ts | |||
@@ -0,0 +1,5 @@ | |||
1 | import { UserRegister } from './user-register.model' | ||
2 | |||
3 | export interface UserRegistrationRequest extends UserRegister { | ||
4 | registrationReason: string | ||
5 | } | ||
diff --git a/shared/models/users/registration/user-registration-state.model.ts b/shared/models/users/registration/user-registration-state.model.ts new file mode 100644 index 000000000..e4c835f78 --- /dev/null +++ b/shared/models/users/registration/user-registration-state.model.ts | |||
@@ -0,0 +1,5 @@ | |||
1 | export const enum UserRegistrationState { | ||
2 | PENDING = 1, | ||
3 | REJECTED = 2, | ||
4 | ACCEPTED = 3 | ||
5 | } | ||
diff --git a/shared/models/users/registration/user-registration-update-state.model.ts b/shared/models/users/registration/user-registration-update-state.model.ts new file mode 100644 index 000000000..636e22c32 --- /dev/null +++ b/shared/models/users/registration/user-registration-update-state.model.ts | |||
@@ -0,0 +1,3 @@ | |||
1 | export interface UserRegistrationUpdateState { | ||
2 | moderationResponse: string | ||
3 | } | ||
diff --git a/shared/models/users/registration/user-registration.model.ts b/shared/models/users/registration/user-registration.model.ts new file mode 100644 index 000000000..0d74dc28b --- /dev/null +++ b/shared/models/users/registration/user-registration.model.ts | |||
@@ -0,0 +1,29 @@ | |||
1 | import { UserRegistrationState } from './user-registration-state.model' | ||
2 | |||
3 | export interface UserRegistration { | ||
4 | id: number | ||
5 | |||
6 | state: { | ||
7 | id: UserRegistrationState | ||
8 | label: string | ||
9 | } | ||
10 | |||
11 | registrationReason: string | ||
12 | moderationResponse: string | ||
13 | |||
14 | username: string | ||
15 | email: string | ||
16 | emailVerified: boolean | ||
17 | |||
18 | accountDisplayName: string | ||
19 | |||
20 | channelHandle: string | ||
21 | channelDisplayName: string | ||
22 | |||
23 | createdAt: Date | ||
24 | updatedAt: Date | ||
25 | |||
26 | user?: { | ||
27 | id: number | ||
28 | } | ||
29 | } | ||