From 1f20622f2b087eaf8738d60fae00a44b9c558ca3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 7 Jun 2019 16:59:53 +0200 Subject: 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 --- shared/extra-utils/users/users.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'shared/extra-utils/users') 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 function registerUserWithChannel (options: { url: string, - user: { username: string, password: string }, + user: { username: string, password: string, displayName?: string }, channel: { name: string, displayName: string } }) { const path = '/api/v1/users/register' @@ -84,6 +84,10 @@ function registerUserWithChannel (options: { channel: options.channel } + if (options.user.displayName) { + Object.assign(body, { displayName: options.user.displayName }) + } + return makePostBodyRequest({ url: options.url, path, -- cgit v1.2.3