diff --git a/peertube-plugin-auth-openid-connect/main.js b/peertube-plugin-auth-openid-connect/main.js index 68a6fc2..7e8ccc6 100644 --- a/peertube-plugin-auth-openid-connect/main.js +++ b/peertube-plugin-auth-openid-connect/main.js @@ -239,7 +239,11 @@ async function handleCb (peertubeHelpers, settingsManager, req, res) { let role if (settings['role-property']) { - role = parseInt('' + userInfo[settings['role-property']], 10) + if (Array.isArray(settings['role-property'])){ + role = parseInt('' + userInfo[settings['role-property']][0], 10); + } else { + role = parseInt('' + userInfo[settings['role-property']], 10) + } } let displayName