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 <kmineh0151@gmail.com>
This commit is contained in:
Dimitris Sotirakis 2022-01-18 18:03:16 +02:00 committed by GitHub
parent 2048060df0
commit c1ba0afdc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,