@@ -12,15 +12,19 @@ if (Meteor.isClient) {
12
12
AzureAd . requestCredential ( options , credentialRequestCompleteCallback ) ;
13
13
} ;
14
14
} else {
15
- Accounts . addAutopublishFields ( {
16
- forLoggedInUser : _ . map (
17
- AzureAd . whitelistedFields . concat ( [ 'accessToken' , 'expiresAt' ] ) , // don't publish refresh token
18
- function ( subfield ) { return 'services.azureAd.' + subfield ; } ) ,
15
+ var fieldsForLoggedInusers = _ . map (
16
+ AzureAd . whitelistedFields . concat ( [ 'accessToken' , 'expiresAt' ] ) , // don't publish refresh token
17
+ function ( subfield ) { return 'services.azureAd.' + subfield ; }
18
+ ) ;
19
+ var fieldsForOtherUsers = _ . map (
20
+ // even with autopublish, no legitimate web app should be
21
+ // publishing all users' emails
22
+ _ . without ( AzureAd . whitelistedFields , 'mail' , 'userPrincipleName' ) ,
23
+ function ( subfield ) { return 'services.azureAd.' + subfield ; }
24
+ ) ;
19
25
20
- forOtherUsers : _ . map (
21
- // even with autopublish, no legitimate web app should be
22
- // publishing all users' emails
23
- _ . without ( AzureAd . whitelistedFields , 'mail' , 'userPrincipleName' ) ,
24
- function ( subfield ) { return 'services.azureAd.' + subfield ; } )
26
+ Accounts . addAutopublishFields ( {
27
+ forLoggedInUser : fieldsForLoggedInusers ,
28
+ forOtherUsers : fieldsForOtherUsers
25
29
} ) ;
26
30
}
0 commit comments