Fix ldap weight setting

This commit is contained in:
Chocobozzz 2020-04-30 10:22:59 +02:00
parent 9b66758c3d
commit fac2f7afe6
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 7 additions and 3 deletions

View File

@ -84,10 +84,10 @@ async function register ({
login: options => login(peertubeHelpers, settingsManager, options)
})
store.weight = await settingsManager.getSetting('weight')
setWeight(await settingsManager.getSetting('weight'))
settingsManager.onSettingsChange(settings => {
if (settigns && typeof settings.weight === 'number') store.weight = weight
if (settings && settings.weight) setWeight(settings.weight)
})
}
@ -102,6 +102,10 @@ module.exports = {
// ############################################################################
function setWeight (weight) {
store.weight = parseInt(weight + '', 10)
}
async function login (peertubeHelpers, settingsManager, options) {
const logger = peertubeHelpers.logger

View File

@ -1,6 +1,6 @@
{
"name": "peertube-plugin-auth-ldap",
"version": "0.0.1",
"version": "0.0.3",
"description": "Add LDAP support to login form in PeerTube.",
"engine": {
"peertube": ">=2.2.0"