From 4c1d638fe58f29ada1c86b8a395fef4e39069c9c Mon Sep 17 00:00:00 2001 From: Caspar Neumann Date: Fri, 13 Dec 2024 11:47:20 +0100 Subject: [PATCH] Wrap changeUserPasswordByPersonId --- src/core/ldap/domain/ldap-client.service.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/core/ldap/domain/ldap-client.service.ts b/src/core/ldap/domain/ldap-client.service.ts index 15c754117..bc2984ead 100644 --- a/src/core/ldap/domain/ldap-client.service.ts +++ b/src/core/ldap/domain/ldap-client.service.ts @@ -110,6 +110,13 @@ export class LdapClientService { ); } + public async changeUserPasswordByPersonId(personId: PersonID, referrer: PersonReferrer): Promise> { + return this.executeWithRetry( + () => this.changeUserPasswordByPersonIdInternal(personId, referrer), + LdapClientService.DEFAULT_RETRIES, + ); + } + public async isLehrerExisting(referrer: string, domain: string): Promise> { return this.executeWithRetry( () => this.isLehrerExistingInternal(referrer, domain), @@ -483,7 +490,10 @@ export class LdapClientService { }); } - public async changeUserPasswordByPersonId(personId: PersonID, referrer: PersonReferrer): Promise> { + private async changeUserPasswordByPersonIdInternal( + personId: PersonID, + referrer: PersonReferrer, + ): Promise> { // Converted to avoid PersonRepository-ref, UEM-password-generation //const referrer: string | undefined = await this.getPersonReferrerOrUndefined(personId); const userPassword: string = generatePassword();