if returned value for role is an array, use first element
This improves Keycloak compatibility as if Multivalued is set to false in Mappers, return value will still be an array.
This commit is contained in:
parent
0cbf9a69f1
commit
1f7f7f609c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user