mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 04:57:07 -04:00
Merge pull request #4788 from Viehlieb/4786_fix_group_routine
4786 fix group routine
This commit is contained in:
commit
a4f99a3a55
2 changed files with 5 additions and 8 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue