aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-06-11 11:54:33 +0200
committerChocobozzz <me@florianbigard.com>2019-06-11 14:31:11 +0200
commitd1ab89deb79f70c439b58750d044d9cadf1194e5 (patch)
tree3cd18a0a8a3bf7497aec9d803c759bf54656115c /shared
parentfff77ba23191f9bca959d5989a1f1df331dbac0b (diff)
downloadPeerTube-d1ab89deb79f70c439b58750d044d9cadf1194e5.tar.gz
PeerTube-d1ab89deb79f70c439b58750d044d9cadf1194e5.tar.zst
PeerTube-d1ab89deb79f70c439b58750d044d9cadf1194e5.zip
Handle email update on server
Diffstat (limited to 'shared')
-rw-r--r--shared/extra-utils/users/users.ts7
-rw-r--r--shared/models/users/user.model.ts1
2 files changed, 6 insertions, 2 deletions
diff --git a/shared/extra-utils/users/users.ts b/shared/extra-utils/users/users.ts
index c09211b71..1c39881d6 100644
--- a/shared/extra-utils/users/users.ts
+++ b/shared/extra-utils/users/users.ts
@@ -323,13 +323,16 @@ function askSendVerifyEmail (url: string, email: string) {
323 }) 323 })
324} 324}
325 325
326function verifyEmail (url: string, userId: number, verificationString: string, statusCodeExpected = 204) { 326function verifyEmail (url: string, userId: number, verificationString: string, isPendingEmail = false, statusCodeExpected = 204) {
327 const path = '/api/v1/users/' + userId + '/verify-email' 327 const path = '/api/v1/users/' + userId + '/verify-email'
328 328
329 return makePostBodyRequest({ 329 return makePostBodyRequest({
330 url, 330 url,
331 path, 331 path,
332 fields: { verificationString }, 332 fields: {
333 verificationString,
334 isPendingEmail
335 },
333 statusCodeExpected 336 statusCodeExpected
334 }) 337 })
335} 338}
diff --git a/shared/models/users/user.model.ts b/shared/models/users/user.model.ts
index 2f6a3c719..b5823b47a 100644
--- a/shared/models/users/user.model.ts
+++ b/shared/models/users/user.model.ts
@@ -9,6 +9,7 @@ export interface User {
9 id: number 9 id: number
10 username: string 10 username: string
11 email: string 11 email: string
12 pendingEmail: string | null
12 emailVerified: boolean 13 emailVerified: boolean
13 nsfwPolicy: NSFWPolicyType 14 nsfwPolicy: NSFWPolicyType
14 15