aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/users/users.ts
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/extra-utils/users/users.ts
parentfff77ba23191f9bca959d5989a1f1df331dbac0b (diff)
downloadPeerTube-d1ab89deb79f70c439b58750d044d9cadf1194e5.tar.gz
PeerTube-d1ab89deb79f70c439b58750d044d9cadf1194e5.tar.zst
PeerTube-d1ab89deb79f70c439b58750d044d9cadf1194e5.zip
Handle email update on server
Diffstat (limited to 'shared/extra-utils/users/users.ts')
-rw-r--r--shared/extra-utils/users/users.ts7
1 files changed, 5 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}