Merge pull request #4450 from danielkaiser/fix-oidc-no-groups-in-userinfo

Fix oidc login when no group data is present
This commit is contained in:
Lauri Ojansivu 2022-04-05 00:24:33 +03:00 committed by GitHub
commit 08f188c45f
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});