diff --git a/package.json b/package.json index 2d78558..3ce5607 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aldap", - "version": "1.1.0", + "version": "1.1.1", "description": "Authentication LDAP server", "repository": "git@gitlab.com:ArisuOngaku/aldap.git", "author": "Alice Gaudon ", diff --git a/src/LDAPServerComponent.ts b/src/LDAPServerComponent.ts index 6c5e3bf..b5f9e45 100644 --- a/src/LDAPServerComponent.ts +++ b/src/LDAPServerComponent.ts @@ -57,5 +57,22 @@ export default class LDAPServerComponent extends ApplicationComponent { this.server.listen(8389, '127.0.0.1', () => { Logger.info(`LDAP server listening on ${this.server!.url}`); }); + this.server.on('close', () => { + Logger.info('LDAP server closed.'); + }); + } + + + public async stop(): Promise { + await new Promise(resolve => { + if (this.server) { + // @ts-ignore + this.server.close(() => { + resolve(); + }); + } else { + resolve(); + } + }); } } \ No newline at end of file