aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/users
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-09-26 16:28:15 +0200
committerChocobozzz <me@florianbigard.com>2018-09-26 16:28:27 +0200
commita890d1e0d30851741392e6e7f14acffe685d28e0 (patch)
tree40f6d0c4643f795670943e176d60b2e85a0fb6e0 /server/tests/utils/users
parentbe1206bb934c223893a652be5f1f6c911c9c66be (diff)
downloadPeerTube-a890d1e0d30851741392e6e7f14acffe685d28e0.tar.gz
PeerTube-a890d1e0d30851741392e6e7f14acffe685d28e0.tar.zst
PeerTube-a890d1e0d30851741392e6e7f14acffe685d28e0.zip
Check current password on server side
Diffstat (limited to 'server/tests/utils/users')
-rw-r--r--server/tests/utils/users/users.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/server/tests/utils/users/users.ts b/server/tests/utils/users/users.ts
index cd1b07701..41d8ce265 100644
--- a/server/tests/utils/users/users.ts
+++ b/server/tests/utils/users/users.ts
@@ -162,6 +162,7 @@ function unblockUser (url: string, userId: number | string, accessToken: string,
162function updateMyUser (options: { 162function updateMyUser (options: {
163 url: string 163 url: string
164 accessToken: string, 164 accessToken: string,
165 currentPassword?: string,
165 newPassword?: string, 166 newPassword?: string,
166 nsfwPolicy?: NSFWPolicyType, 167 nsfwPolicy?: NSFWPolicyType,
167 email?: string, 168 email?: string,
@@ -172,6 +173,7 @@ function updateMyUser (options: {
172 const path = '/api/v1/users/me' 173 const path = '/api/v1/users/me'
173 174
174 const toSend = {} 175 const toSend = {}
176 if (options.currentPassword !== undefined && options.currentPassword !== null) toSend['currentPassword'] = options.currentPassword
175 if (options.newPassword !== undefined && options.newPassword !== null) toSend['password'] = options.newPassword 177 if (options.newPassword !== undefined && options.newPassword !== null) toSend['password'] = options.newPassword
176 if (options.nsfwPolicy !== undefined && options.nsfwPolicy !== null) toSend['nsfwPolicy'] = options.nsfwPolicy 178 if (options.nsfwPolicy !== undefined && options.nsfwPolicy !== null) toSend['nsfwPolicy'] = options.nsfwPolicy
177 if (options.autoPlayVideo !== undefined && options.autoPlayVideo !== null) toSend['autoPlayVideo'] = options.autoPlayVideo 179 if (options.autoPlayVideo !== undefined && options.autoPlayVideo !== null) toSend['autoPlayVideo'] = options.autoPlayVideo