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/server/startup/cloudRegistration.ts

20 lines
822 B

import { Settings } from '@rocket.chat/models';
export async function ensureCloudWorkspaceRegistered(): Promise<void> {
const cloudWorkspaceClientId = await Settings.getValueById('Cloud_Workspace_Client_Id');
const cloudWorkspaceClientSecret = await Settings.getValueById('Cloud_Workspace_Client_Secret');
const showSetupWizard = await Settings.getValueById('Show_Setup_Wizard');
// skip if both fields are already set, which means the workspace is already registered
if (!!cloudWorkspaceClientId && !!cloudWorkspaceClientSecret) {
return;
}
// skip if the setup wizard still not completed
if (showSetupWizard !== 'completed') {
return;
}
// otherwise, set the setup wizard to in_progress forcing admins to complete the registration
await Settings.updateValueById('Show_Setup_Wizard', 'in_progress');
}