The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/packages/rocketchat-tokenpass/common.js

36 lines
885 B

/* global CustomOAuth */
const config = {
serverURL: '',
identityPath: '/oauth/user',
authorizePath: '/oauth/authorize',
tokenPath: '/oauth/access-token',
scope: 'user,tca,private-balances',
tokenSentVia: 'payload',
usernameField: 'username',
mergeUsers: true,
addAutopublishFields: {
forLoggedInUser: ['services.tokenpass'],
forOtherUsers: ['services.tokenpass.name']
}
};
const Tokenpass = new CustomOAuth('tokenpass', config);
if (Meteor.isServer) {
Meteor.startup(function() {
RocketChat.settings.get('API_Tokenpass_URL', function(key, value) {
config.serverURL = value;
Tokenpass.configure(config);
});
});
} else {
Meteor.startup(function() {
Tracker.autorun(function() {
if (RocketChat.settings.get('API_Tokenpass_URL')) {
config.serverURL = RocketChat.settings.get('API_Tokenpass_URL');
Tokenpass.configure(config);
}
});
});
}