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-gitlab/common.js

33 lines
859 B

/* global CustomOAuth */
import { Meteor } from 'meteor/meteor';
import { Tracker } from 'meteor/tracker';
const config = {
serverURL: 'https://gitlab.com',
identityPath: '/api/v3/user',
scope: 'read_user',
addAutopublishFields: {
forLoggedInUser: ['services.gitlab'],
forOtherUsers: ['services.gitlab.username'],
},
};
const Gitlab = new CustomOAuth('gitlab', config);
if (Meteor.isServer) {
Meteor.startup(function() {
RocketChat.settings.get('API_Gitlab_URL', function(key, value) {
config.serverURL = value.trim().replace(/\/*$/, '');
Gitlab.configure(config);
});
});
} else {
Meteor.startup(function() {
Tracker.autorun(function() {
if (RocketChat.settings.get('API_Gitlab_URL')) {
config.serverURL = RocketChat.settings.get('API_Gitlab_URL').trim().replace(/\/*$/, '');
Gitlab.configure(config);
}
});
});
}