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/app/tokenpass/server/lib.ts

30 lines
842 B

import { Meteor } from 'meteor/meteor';
import type { OauthConfig } from '@rocket.chat/core-typings';
import { settings } from '../../settings/server';
import { CustomOAuth } from '../../custom-oauth/server/custom_oauth_server';
const config: OauthConfig = {
serverURL: '',
identityPath: '/oauth/user',
authorizePath: '/oauth/authorize',
tokenPath: '/oauth/access-token',
scope: 'user',
tokenSentVia: 'payload',
usernameField: 'username',
mergeUsers: true,
addAutopublishFields: {
forLoggedInUser: ['services.tokenpass'],
forOtherUsers: ['services.tokenpass.name'],
},
accessTokenParam: 'access_token',
};
const Tokenpass = new CustomOAuth('tokenpass', config);
Meteor.startup(function () {
settings.watch<string>('API_Tokenpass_URL', function (value) {
config.serverURL = value;
Tokenpass.configure(config);
});
});