Edit profil and change password menus are not displayed when SSO authentication is used

This commit is contained in:
Emile NDAGIJIMANA 2021-09-01 11:40:54 +02:00
parent 6d9d69e01d
commit c7cc9273a6
5 changed files with 21 additions and 8 deletions

View file

@ -156,6 +156,7 @@ BlazeComponent.extendComponent({
if (FlowRouter.getRouteName() === 'home'){ if (FlowRouter.getRouteName() === 'home'){
query.$and[2].$or.push({'members.userId': Meteor.userId()}); query.$and[2].$or.push({'members.userId': Meteor.userId()});
if(allowPrivateVisibilityOnly !== undefined && allowPrivateVisibilityOnly.booleanValue){ if(allowPrivateVisibilityOnly !== undefined && allowPrivateVisibilityOnly.booleanValue){
query.$and.push({'permission': 'private'}); query.$and.push({'permission': 'private'});
} }

View file

@ -49,10 +49,11 @@ template(name="memberMenuPopup")
i.fa.fa-lock i.fa.fa-lock
| {{_ 'admin-panel'}} | {{_ 'admin-panel'}}
hr hr
li if isNotOAuth2AuthenticationMethod
a.js-edit-profile li
i.fa.fa-user a.js-edit-profile
| {{_ 'edit-profile'}} i.fa.fa-user
| {{_ 'edit-profile'}}
li li
a.js-change-settings a.js-change-settings
i.fa.fa-cog i.fa.fa-cog
@ -62,10 +63,11 @@ template(name="memberMenuPopup")
i.fa.fa-picture-o i.fa.fa-picture-o
| {{_ 'edit-avatar'}} | {{_ 'edit-avatar'}}
unless isSandstorm unless isSandstorm
li if isNotOAuth2AuthenticationMethod
a.js-change-password li
i.fa.fa-key a.js-change-password
| {{_ 'changePasswordPopup-title'}} i.fa.fa-key
| {{_ 'changePasswordPopup-title'}}
li li
a.js-change-language a.js-change-language
i.fa.fa-flag i.fa.fa-flag

View file

@ -22,6 +22,14 @@ Template.memberMenuPopup.helpers({
return false; return false;
} }
}, },
isNotOAuth2AuthenticationMethod(){
currentUser = Meteor.user();
if (currentUser) {
return currentUser.authenticationMethod != 'OAuth2';
} else {
return true;
}
}
}); });
Template.memberMenuPopup.events({ Template.memberMenuPopup.events({

View file

@ -445,6 +445,7 @@ Users.safeFields = {
'profile.initials': 1, 'profile.initials': 1,
orgs: 1, orgs: 1,
teams: 1, teams: 1,
authenticationMethod: 1,
}; };
if (Meteor.isClient) { if (Meteor.isClient) {

View file

@ -25,6 +25,7 @@ Meteor.publish('user-admin', function() {
isAdmin: 1, isAdmin: 1,
teams: 1, teams: 1,
orgs: 1, orgs: 1,
authenticationMethod: 1,
}, },
}); });
}); });