From d3756d38eea4486e865984e3130f7722c11ba30c Mon Sep 17 00:00:00 2001 From: Dimitris Sotirakis Date: Tue, 18 Jan 2022 17:53:03 +0200 Subject: [PATCH] [v8.3.x] GetUserInfo: return an error if no user was found (#211) (#44166) * return an error if no user was found * update condition (cherry picked from commit ec87405543fe8032a0c2769d3ec97536b7a749ef) 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 24ad631d521..75431745a7f 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(query *models.GetAuthInfoQuery) error { + if query.UserId == 0 && query.AuthId == "" { + return models.ErrUserNotFound + } + userAuth := &models.UserAuth{ UserId: query.UserId, AuthModule: query.AuthModule,