aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-02-01 15:39:13 +0100
committerChocobozzz <me@florianbigard.com>2021-02-01 15:39:13 +0100
commit6d989edc66e7b541fcf97c2a4a6f91cbf960060a (patch)
tree9c72977cf05eee2b3a84dd1867ec60ef491b0900 /shared
parentcb5c2abc99c2e222fe18621f79cb68b805678e15 (diff)
downloadPeerTube-6d989edc66e7b541fcf97c2a4a6f91cbf960060a.tar.gz
PeerTube-6d989edc66e7b541fcf97c2a4a6f91cbf960060a.tar.zst
PeerTube-6d989edc66e7b541fcf97c2a4a6f91cbf960060a.zip
Add ability to update plugin auth
Diffstat (limited to 'shared')
-rw-r--r--shared/extra-utils/users/users.ts2
-rw-r--r--shared/models/users/user-update.model.ts1
2 files changed, 3 insertions, 0 deletions
diff --git a/shared/extra-utils/users/users.ts b/shared/extra-utils/users/users.ts
index c683dcdd1..db532dbb0 100644
--- a/shared/extra-utils/users/users.ts
+++ b/shared/extra-utils/users/users.ts
@@ -288,6 +288,7 @@ function updateUser (options: {
288 videoQuotaDaily?: number 288 videoQuotaDaily?: number
289 password?: string 289 password?: string
290 adminFlags?: UserAdminFlag 290 adminFlags?: UserAdminFlag
291 pluginAuth?: string
291 role?: UserRole 292 role?: UserRole
292}) { 293}) {
293 const path = '/api/v1/users/' + options.userId 294 const path = '/api/v1/users/' + options.userId
@@ -300,6 +301,7 @@ function updateUser (options: {
300 if (options.videoQuotaDaily !== undefined && options.videoQuotaDaily !== null) toSend['videoQuotaDaily'] = options.videoQuotaDaily 301 if (options.videoQuotaDaily !== undefined && options.videoQuotaDaily !== null) toSend['videoQuotaDaily'] = options.videoQuotaDaily
301 if (options.role !== undefined && options.role !== null) toSend['role'] = options.role 302 if (options.role !== undefined && options.role !== null) toSend['role'] = options.role
302 if (options.adminFlags !== undefined && options.adminFlags !== null) toSend['adminFlags'] = options.adminFlags 303 if (options.adminFlags !== undefined && options.adminFlags !== null) toSend['adminFlags'] = options.adminFlags
304 if (options.pluginAuth !== undefined) toSend['pluginAuth'] = options.pluginAuth
303 305
304 return makePutBodyRequest({ 306 return makePutBodyRequest({
305 url: options.url, 307 url: options.url,
diff --git a/shared/models/users/user-update.model.ts b/shared/models/users/user-update.model.ts
index fa43487ac..158738545 100644
--- a/shared/models/users/user-update.model.ts
+++ b/shared/models/users/user-update.model.ts
@@ -9,4 +9,5 @@ export interface UserUpdate {
9 videoQuotaDaily?: number 9 videoQuotaDaily?: number
10 role?: UserRole 10 role?: UserRole
11 adminFlags?: UserAdminFlag 11 adminFlags?: UserAdminFlag
12 pluginAuth?: string
12} 13}