Merge pull request #4788 from Viehlieb/4786_fix_group_routine

4786 fix group routine
This commit is contained in:
Lauri Ojansivu 2022-12-24 09:42:32 +02:00 committed by GitHub
commit a4f99a3a55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 8 deletions

View file

@ -214,11 +214,6 @@ class KnownUser {
}
static onLogin(loginInfo) {
//get the data from oidc login and remove again?
if(loginInfo.type ==='oidc'){
Meteor.call('groupRoutineOnLogin', loginInfo.user.services.oidc, loginInfo.user._id);
return;
}
if (loginInfo.type !== 'password') {
return;
}

View file

@ -81,7 +81,6 @@ OAuth.registerService('oidc', 2, null, function (query) {
//temporarily store data from oidc in user.services.oidc.groups to update groups
serviceData.groups = (userinfo["groups"] && userinfo["wekanGroups"]) ? userinfo["wekanGroups"] : userinfo["groups"];
// groups arriving as array of strings indicate there is no scope set in oidc privider
// to assign teams and keep admin privileges
// data needs to be treated differently.
@ -105,6 +104,9 @@ OAuth.registerService('oidc', 2, null, function (query) {
}
});
}
Meteor.call('groupRoutineOnLogin',serviceData, serviceData.id);
return {
serviceData: serviceData,
options: { profile: profile }
@ -285,9 +287,9 @@ Meteor.methods({
var propagateOidcData = process.env.PROPAGATE_OIDC_DATA || false;
if (propagateOidcData)
{
users= Meteor.users;
user = users.findOne({'_id': userId});
user = users.findOne({'services.oidc.id': userId});
if(user)
{
//updates/creates Groups and user admin privileges accordingly