diff --git a/pkg/services/user/userimpl/store.go b/pkg/services/user/userimpl/store.go index 76a12396390..dccc3145728 100644 --- a/pkg/services/user/userimpl/store.go +++ b/pkg/services/user/userimpl/store.go @@ -24,7 +24,6 @@ type store interface { GetByEmail(context.Context, *user.GetUserByEmailQuery) (*user.User, error) Delete(context.Context, int64) error LoginConflict(ctx context.Context, login, email string) error - CaseInsensitiveLoginConflict(context.Context, string, string) error Update(context.Context, *user.UpdateUserCommand) error UpdateLastSeenAt(context.Context, *user.UpdateUserLastSeenAtCommand) error GetSignedInUser(context.Context, *user.GetSignedInUserQuery) (*user.SignedInUser, error) @@ -114,22 +113,6 @@ func (ss *sqlStore) notServiceAccountFilter() string { ss.dialect.BooleanStr(false)) } -func (ss *sqlStore) CaseInsensitiveLoginConflict(ctx context.Context, login, email string) error { - users := make([]user.User, 0) - err := ss.db.WithDbSession(ctx, func(sess *db.Session) error { - if err := sess.Where("LOWER(email)=LOWER(?) OR LOWER(login)=LOWER(?)", - email, login).Find(&users); err != nil { - return err - } - - if len(users) > 1 { - return &user.ErrCaseInsensitiveLoginConflict{Users: users} - } - return nil - }) - return err -} - func (ss *sqlStore) GetByLogin(ctx context.Context, query *user.GetUserByLoginQuery) (*user.User, error) { // enforcement of lowercase due to forcement of caseinsensitive login query.LoginOrEmail = strings.ToLower(query.LoginOrEmail) diff --git a/pkg/services/user/userimpl/user_test.go b/pkg/services/user/userimpl/user_test.go index 304932d65b6..346f8545267 100644 --- a/pkg/services/user/userimpl/user_test.go +++ b/pkg/services/user/userimpl/user_test.go @@ -290,10 +290,6 @@ func (f *FakeUserStore) GetByID(context.Context, int64) (*user.User, error) { return f.ExpectedUser, f.ExpectedError } -func (f *FakeUserStore) CaseInsensitiveLoginConflict(context.Context, string, string) error { - return f.ExpectedError -} - func (f *FakeUserStore) LoginConflict(context.Context, string, string) error { return f.ExpectedError }