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
This commit is contained in:
Chocobozzz 2019-06-07 16:59:53 +02:00
parent 1a03bea0c4
commit 1f20622f2b
No known key found for this signature in database
GPG key ID: 583A612D890159BE
23 changed files with 253 additions and 76 deletions

View file

@ -184,7 +184,7 @@ async function createUser (req: express.Request, res: express.Response) {
adminFlags: body.adminFlags || UserAdminFlag.NONE
})
const { user, account } = await createUserAccountAndChannelAndPlaylist(userToCreate)
const { user, account } = await createUserAccountAndChannelAndPlaylist({ userToCreate: userToCreate })
auditLogger.create(getAuditIdFromRes(res), new UserAuditView(user.toFormattedJSON()))
logger.info('User %s with its channel and account created.', body.username)
@ -214,7 +214,11 @@ async function registerUser (req: express.Request, res: express.Response) {
emailVerified: CONFIG.SIGNUP.REQUIRES_EMAIL_VERIFICATION ? false : null
})
const { user } = await createUserAccountAndChannelAndPlaylist(userToCreate, body.channel)
const { user } = await createUserAccountAndChannelAndPlaylist({
userToCreate: userToCreate,
userDisplayName: body.displayName || undefined,
channelNames: body.channel
})
auditLogger.create(body.username, new UserAuditView(user.toFormattedJSON()))
logger.info('User %s with its channel and account registered.', body.username)