Peertube 3.2.0 will provide user.Account.name.

This commit is contained in:
John Livingston
2021-05-05 16:30:18 +02:00
parent 3658ee797a
commit 787fed19d0
3 changed files with 34 additions and 14 deletions

View File

@ -98,13 +98,8 @@ async function initApiRouter (options: RegisterServerOptions): Promise<Router> {
res.sendStatus(403)
return
}
let userId: number | undefined
if (user.id) {
userId = parseInt(user.id)
if (Number.isNaN(userId)) { userId = undefined }
}
const password: string = await prosodyRegisterUser(user.username)
const nickname: string | undefined = userId ? (await getUserNickname(options, userId)) : undefined
const nickname: string | undefined = await getUserNickname(options, user)
res.status(200).json({
jid: user.username + '@localhost',
password: password,