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/apps/meteor/client/startup/customOAuth.ts

25 lines
639 B

import { Meteor } from 'meteor/meteor';
import { ServiceConfiguration } from 'meteor/service-configuration';
import { CustomOAuth } from '../../app/custom-oauth/client/custom_oauth_client';
Meteor.startup(() => {
ServiceConfiguration.configurations
.find({
custom: true,
})
.observe({
async added(record) {
const { isOauthCustomConfiguration } = await import('@rocket.chat/rest-typings');
if (!isOauthCustomConfiguration(record)) {
return;
}
new CustomOAuth(record.service, {
serverURL: record.serverURL,
authorizePath: record.authorizePath,
scope: record.scope,
});
},
});
});