aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/users/me.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/users/me.ts')
-rw-r--r--server/controllers/api/users/me.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/server/controllers/api/users/me.ts b/server/controllers/api/users/me.ts
index 6bacdbbb6..1125771d4 100644
--- a/server/controllers/api/users/me.ts
+++ b/server/controllers/api/users/me.ts
@@ -197,7 +197,7 @@ async function updateMe (req: express.Request, res: express.Response) {
197 const keysToUpdate: (keyof UserUpdateMe & keyof AttributesOnly<UserModel>)[] = [ 197 const keysToUpdate: (keyof UserUpdateMe & keyof AttributesOnly<UserModel>)[] = [
198 'password', 198 'password',
199 'nsfwPolicy', 199 'nsfwPolicy',
200 'webTorrentEnabled', 200 'p2pEnabled',
201 'autoPlayVideo', 201 'autoPlayVideo',
202 'autoPlayNextVideo', 202 'autoPlayNextVideo',
203 'autoPlayNextVideoPlaylist', 203 'autoPlayNextVideoPlaylist',
@@ -213,6 +213,12 @@ async function updateMe (req: express.Request, res: express.Response) {
213 if (body[key] !== undefined) user.set(key, body[key]) 213 if (body[key] !== undefined) user.set(key, body[key])
214 } 214 }
215 215
216 if (body.p2pEnabled !== undefined) {
217 user.set('p2pEnabled', body.p2pEnabled)
218 } else if (body.webTorrentEnabled !== undefined) { // FIXME: deprecated in 4.1
219 user.set('p2pEnabled', body.webTorrentEnabled)
220 }
221
216 if (body.email !== undefined) { 222 if (body.email !== undefined) {
217 if (CONFIG.SIGNUP.REQUIRES_EMAIL_VERIFICATION) { 223 if (CONFIG.SIGNUP.REQUIRES_EMAIL_VERIFICATION) {
218 user.pendingEmail = body.email 224 user.pendingEmail = body.email