aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/users
diff options
context:
space:
mode:
authorJosh Morel <morel.josh@hotmail.com>2018-11-21 02:48:29 -0500
committerChocobozzz <me@florianbigard.com>2018-11-21 08:48:29 +0100
commitfc2ec87a8c4dcfbb91a1a62cf4c07a2a8e6a50fe (patch)
treea2cea5e299c5f1a731da99277949ea2f0bb35659 /client/src/app/shared/users
parent04b8c3fba614efc3827f583096c78b08cb668470 (diff)
downloadPeerTube-fc2ec87a8c4dcfbb91a1a62cf4c07a2a8e6a50fe.tar.gz
PeerTube-fc2ec87a8c4dcfbb91a1a62cf4c07a2a8e6a50fe.tar.zst
PeerTube-fc2ec87a8c4dcfbb91a1a62cf4c07a2a8e6a50fe.zip
enable email verification by admin (#1348)
* enable email verification by admin * rename/label to set email as verified to be more explicit that admin is not sending another email to confirm * add update user emailVerified check-params test * make user.model emailVerified property required
Diffstat (limited to 'client/src/app/shared/users')
-rw-r--r--client/src/app/shared/users/user.model.ts2
-rw-r--r--client/src/app/shared/users/user.service.ts9
2 files changed, 11 insertions, 0 deletions
diff --git a/client/src/app/shared/users/user.model.ts b/client/src/app/shared/users/user.model.ts
index 7c840ffa7..9819829fd 100644
--- a/client/src/app/shared/users/user.model.ts
+++ b/client/src/app/shared/users/user.model.ts
@@ -15,6 +15,7 @@ export type UserConstructorHash = {
15 username: string, 15 username: string,
16 email: string, 16 email: string,
17 role: UserRole, 17 role: UserRole,
18 emailVerified?: boolean,
18 videoQuota?: number, 19 videoQuota?: number,
19 videoQuotaDaily?: number, 20 videoQuotaDaily?: number,
20 nsfwPolicy?: NSFWPolicyType, 21 nsfwPolicy?: NSFWPolicyType,
@@ -31,6 +32,7 @@ export class User implements UserServerModel {
31 id: number 32 id: number
32 username: string 33 username: string
33 email: string 34 email: string
35 emailVerified: boolean
34 role: UserRole 36 role: UserRole
35 nsfwPolicy: NSFWPolicyType 37 nsfwPolicy: NSFWPolicyType
36 webTorrentEnabled: boolean 38 webTorrentEnabled: boolean
diff --git a/client/src/app/shared/users/user.service.ts b/client/src/app/shared/users/user.service.ts
index 27a81f0a2..cc5c051f1 100644
--- a/client/src/app/shared/users/user.service.ts
+++ b/client/src/app/shared/users/user.service.ts
@@ -153,6 +153,15 @@ export class UserService {
153 ) 153 )
154 } 154 }
155 155
156 updateUsers (users: User[], userUpdate: UserUpdate) {
157 return from(users)
158 .pipe(
159 concatMap(u => this.authHttp.put(UserService.BASE_USERS_URL + u.id, userUpdate)),
160 toArray(),
161 catchError(err => this.restExtractor.handleError(err))
162 )
163 }
164
156 getUser (userId: number) { 165 getUser (userId: number) {
157 return this.authHttp.get<User>(UserService.BASE_USERS_URL + userId) 166 return this.authHttp.get<User>(UserService.BASE_USERS_URL + userId)
158 .pipe(catchError(err => this.restExtractor.handleError(err))) 167 .pipe(catchError(err => this.restExtractor.handleError(err)))