User: Fix GetByID (#86282)

* Auth: Remove unused lookup param

* Remove case sensitive lookup for GetByID
This commit is contained in:
Karl Persson
2024-04-16 15:24:34 +02:00
committed by GitHub
parent b9285e320a
commit 8520892923
10 changed files with 42 additions and 130 deletions
@@ -368,14 +368,6 @@ func (s *UserSync) lookupByOneOf(ctx context.Context, params login.UserLookupPar
var usr *user.User
var err error
// If not found, try to find the user by id
if params.UserID != nil && *params.UserID != 0 {
usr, err = s.userService.GetByID(ctx, &user.GetUserByIDQuery{ID: *params.UserID})
if err != nil && !errors.Is(err, user.ErrUserNotFound) {
return nil, err
}
}
// If not found, try to find the user by email address
if usr == nil && params.Email != nil && *params.Email != "" {
usr, err = s.userService.GetByEmail(ctx, &user.GetUserByEmailQuery{Email: *params.Email})