diff --git a/packages/cli/src/commands/ldap/reset.ts b/packages/cli/src/commands/ldap/reset.ts index 7b555fc52e..db276c40c1 100644 --- a/packages/cli/src/commands/ldap/reset.ts +++ b/packages/cli/src/commands/ldap/reset.ts @@ -1,5 +1,5 @@ import * as Db from '@/Db'; -import { LDAP_FEATURE_NAME } from '@/Ldap/constants'; +import { LDAP_DEFAULT_CONFIGURATION, LDAP_FEATURE_NAME } from '@/Ldap/constants'; import { In } from 'typeorm'; import { BaseCommand } from '../BaseCommand'; @@ -17,6 +17,11 @@ export class Reset extends BaseCommand { await AuthIdentity.delete({ providerType: 'ldap' }); await User.delete({ id: In(ldapIdentities.map((i) => i.userId)) }); await Settings.delete({ key: LDAP_FEATURE_NAME }); + await Settings.insert({ + key: LDAP_FEATURE_NAME, + value: JSON.stringify(LDAP_DEFAULT_CONFIGURATION), + loadOnStartup: true, + }); this.logger.info('Successfully reset the database to default ldap state.'); } diff --git a/packages/cli/src/commands/start.ts b/packages/cli/src/commands/start.ts index ada08e48ec..bac95bfe3c 100644 --- a/packages/cli/src/commands/start.ts +++ b/packages/cli/src/commands/start.ts @@ -326,13 +326,13 @@ export class Start extends BaseCommand { ); } + await handleLdapInit(); + await Server.start(); // Start to get active workflows and run their triggers await this.activeWorkflowRunner.init(); - await handleLdapInit(); - const editorUrl = GenericHelpers.getBaseUrl(); this.log(`\nEditor is now accessible via:\n${editorUrl}`);