providers/ldap: fix error not being checked correctly when fetching users

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens Langhammer 2023-02-03 18:10:06 +01:00
parent 388367785d
commit 146d54813c
No known key found for this signature in database
1 changed files with 2 additions and 3 deletions

View File

@ -124,12 +124,12 @@ func (ds *DirectSearcher) Search(req *search.Request) (ldap.ServerSearchResult,
return nil
}
u, _, e := searchReq.Execute()
u, _, err := searchReq.Execute()
uapisp.Finish()
if err != nil {
req.Log().WithError(err).Warning("failed to get users")
return e
return err
}
users = &u.Results
@ -152,7 +152,6 @@ func (ds *DirectSearcher) Search(req *search.Request) (ldap.ServerSearchResult,
users = &u
}
return nil
})
}