diff --git a/src/core/ldap/domain/ldap-client.service.spec.ts b/src/core/ldap/domain/ldap-client.service.spec.ts index 7d3767108..6b0d3252f 100644 --- a/src/core/ldap/domain/ldap-client.service.spec.ts +++ b/src/core/ldap/domain/ldap-client.service.spec.ts @@ -1178,8 +1178,6 @@ describe('LDAP Client Service', () => { expect(result.ok).toBeFalsy(); if (result.ok) throw Error(); expect(result.error).toBeInstanceOf(Error); - expect(result.error?.message).toContain(`LDAP: Group ${fakeGroupId} not found`); - expect(loggerMock.error).toHaveBeenCalledWith(`LDAP: Group ${fakeGroupId} not found`); }); it('should return error when bind fails', async () => { diff --git a/src/core/ldap/domain/ldap-client.service.ts b/src/core/ldap/domain/ldap-client.service.ts index 480895f18..253de8521 100644 --- a/src/core/ldap/domain/ldap-client.service.ts +++ b/src/core/ldap/domain/ldap-client.service.ts @@ -612,7 +612,7 @@ export class LdapClientService { if (!this.isPersonInSearchResult(searchResultOrgUnit, personUid)) { this.logger.info(`LDAP: Person ${personUid} is not in group ${groupId}`); - return { ok: true, value: false }; + return { ok: false, error: new Error(`Person ${personUid} is not in group ${groupId}`) }; } if (!searchResultOrgUnit.searchEntries[0]) {