Fix #63: On some old Peertube installations, there can be usernames with upper-case letters. Adding a toLowerCase() for the XMPP jid.
This commit is contained in:
parent
e14007f2e9
commit
3ca97fcf0e
@ -8,12 +8,16 @@
|
|||||||
* Builtin ConverseJS on external XMPP server: new placeholders for the room name: CHANNEL_ID, CHANNEL_NAME.
|
* Builtin ConverseJS on external XMPP server: new placeholders for the room name: CHANNEL_ID, CHANNEL_NAME.
|
||||||
* External webchat tool: new placeholder CHANNEL_ID in the webchat url.
|
* External webchat tool: new placeholder CHANNEL_ID in the webchat url.
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Builtin Prosody: Fix [#63](https://github.com/JohnXLivingston/peertube-plugin-livechat/issues/63). On some old Peertube installations, there can be usernames with upper-case letters. Adding a toLowerCase() for the XMPP jid.
|
||||||
|
|
||||||
## v3.2.0
|
## v3.2.0
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* Builtin Prosody: list existing rooms in the settings page
|
* Builtin Prosody: list existing rooms in the settings page
|
||||||
* Builtin Prosody: new settings to enable local C2S. For example, can be used with Matterbridge (thanks https://github.com/tytan652)
|
* Builtin Prosody: new settings to enable local C2S. For example, can be used with Matterbridge (thanks [https://github.com/tytan652](https://github.com/tytan652))
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
|
|
||||||
@ -158,7 +162,7 @@
|
|||||||
## v1.0.5
|
## v1.0.5
|
||||||
|
|
||||||
* New buttons and logo.
|
* New buttons and logo.
|
||||||
* Fix: changing default value to false for every checkbox settings (Peertube bug in <=3.0.1: https://github.com/Chocobozzz/PeerTube/issues/3838).
|
* Fix: changing default value to false for every checkbox settings (Peertube bug in <=3.0.1: [https://github.com/Chocobozzz/PeerTube/issues/3838](https://github.com/Chocobozzz/PeerTube/issues/3838)).
|
||||||
|
|
||||||
## v1.0.4
|
## v1.0.4
|
||||||
|
|
||||||
|
@ -117,11 +117,16 @@ async function initApiRouter (options: RegisterServerOptions): Promise<Router> {
|
|||||||
res.sendStatus(403)
|
res.sendStatus(403)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// NB 2021-08-05: Peertube usernames should be lowercase. But it seems that
|
||||||
|
// in some old installation, there can be uppercase letters in usernames.
|
||||||
|
// When Peertube checks username unicity, it does a lowercase search.
|
||||||
|
// So it feels safe to normalize usernames like so:
|
||||||
|
const normalizedUsername = user.username.toLowerCase()
|
||||||
const prosodyDomain = await getProsodyDomain(options)
|
const prosodyDomain = await getProsodyDomain(options)
|
||||||
const password: string = await prosodyRegisterUser(user.username)
|
const password: string = await prosodyRegisterUser(normalizedUsername)
|
||||||
const nickname: string | undefined = await getUserNickname(options, user)
|
const nickname: string | undefined = await getUserNickname(options, user)
|
||||||
res.status(200).json({
|
res.status(200).json({
|
||||||
jid: user.username + '@' + prosodyDomain,
|
jid: normalizedUsername + '@' + prosodyDomain,
|
||||||
password: password,
|
password: password,
|
||||||
nickname: nickname
|
nickname: nickname
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user