From c1ba0afdc755d05570d3d917b2e9a6465c882419 Mon Sep 17 00:00:00 2001 From: Dimitris Sotirakis Date: Tue, 18 Jan 2022 18:03:16 +0200 Subject: [PATCH] GetUserInfo: Return an error if no user was found (#44169) * return an error if no user was found * Update database.go Co-authored-by: Kevin Minehart --- pkg/services/login/authinfoservice/database.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/services/login/authinfoservice/database.go b/pkg/services/login/authinfoservice/database.go index da5db5f975d..230d22abe26 100644 --- a/pkg/services/login/authinfoservice/database.go +++ b/pkg/services/login/authinfoservice/database.go @@ -38,6 +38,10 @@ func (s *Implementation) GetExternalUserInfoByLogin(ctx context.Context, query * } func (s *Implementation) GetAuthInfo(ctx context.Context, query *models.GetAuthInfoQuery) error { + if query.UserId == 0 && query.AuthId == "" { + return models.ErrUserNotFound + } + userAuth := &models.UserAuth{ UserId: query.UserId, AuthModule: query.AuthModule,