Update oidc_server.js

This commit is contained in:
Daniel Kaiser 2022-04-04 14:22:47 +02:00 committed by GitHub
parent 2a362a2e85
commit ada770c9e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -88,7 +88,7 @@ OAuth.registerService('oidc', 2, null, function (query) {
// data needs to be treated differently.
// use case: in oidc provider no scope is set, hence no group attributes.
// therefore: keep admin privileges for wekan as before
if(typeof serviceData.groups[0] === "string" )
if(Array.isArray(serviceData.groups) && serviceData.groups.length && typeof serviceData.groups[0] === "string" )
{
user = Meteor.users.findOne({'_id': serviceData.id});