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-lib/server/methods/refreshOAuthService.js

15 lines
604 B

Meteor.methods({
refreshOAuthService() {
if (!Meteor.userId()) {
throw new Meteor.Error('error-invalid-user', 'Invalid user', { method: 'refreshOAuthService' });
}
if (RocketChat.authz.hasPermission(Meteor.userId(), 'add-oauth-service') !== true) {
throw new Meteor.Error('error-action-not-allowed', 'Refresh OAuth Services is not allowed', { method: 'refreshOAuthService', action: 'Refreshing_OAuth_Services' });
}
ServiceConfiguration.configurations.remove({});
RocketChat.models.Settings.update({_id: /^Accounts_OAuth_.+/}, {$set: {_updatedAt: new Date}}, {multi: true});
}
});