aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-06-07 16:59:53 +0200
committerChocobozzz <me@florianbigard.com>2019-06-07 17:05:42 +0200
commit1f20622f2b087eaf8738d60fae00a44b9c558ca3 (patch)
tree1c8554623665ca96b8a1e6f2a6bcb8c1b5a83c2e /shared/extra-utils
parent1a03bea0c42fa1064ce4770157b4fd2e3edd5565 (diff)
downloadPeerTube-1f20622f2b087eaf8738d60fae00a44b9c558ca3.tar.gz
PeerTube-1f20622f2b087eaf8738d60fae00a44b9c558ca3.tar.zst
PeerTube-1f20622f2b087eaf8738d60fae00a44b9c558ca3.zip
Improve registration
* Add ability to set the user display name * Use display name to guess the username/channel name * Add explanations about what is the purpose of a username/channel name * Add a loader at the "done" step
Diffstat (limited to 'shared/extra-utils')
-rw-r--r--shared/extra-utils/users/users.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/shared/extra-utils/users/users.ts b/shared/extra-utils/users/users.ts
index 0f2f0ae15..c09211b71 100644
--- a/shared/extra-utils/users/users.ts
+++ b/shared/extra-utils/users/users.ts
@@ -73,7 +73,7 @@ function registerUser (url: string, username: string, password: string, specialS
73 73
74function registerUserWithChannel (options: { 74function registerUserWithChannel (options: {
75 url: string, 75 url: string,
76 user: { username: string, password: string }, 76 user: { username: string, password: string, displayName?: string },
77 channel: { name: string, displayName: string } 77 channel: { name: string, displayName: string }
78}) { 78}) {
79 const path = '/api/v1/users/register' 79 const path = '/api/v1/users/register'
@@ -84,6 +84,10 @@ function registerUserWithChannel (options: {
84 channel: options.channel 84 channel: options.channel
85 } 85 }
86 86
87 if (options.user.displayName) {
88 Object.assign(body, { displayName: options.user.displayName })
89 }
90
87 return makePostBodyRequest({ 91 return makePostBodyRequest({
88 url: options.url, 92 url: options.url,
89 path, 93 path,