mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(core): Fix issues with LDAP reset and LDAP init (no-changelog) (#5657)
* fix(core): Ldap reset should recreate the default config * fix(core): init ldap before registering the routes for it
This commit is contained in:
committed by
GitHub
parent
ce0d9d2bed
commit
1979eb8a9c
@@ -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.');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user