From 7a5c6b24ae2503955046d2cf79c36e0481d42164 Mon Sep 17 00:00:00 2001 From: Yury Gargay Date: Wed, 25 Oct 2023 00:12:10 +0200 Subject: [PATCH] Fix GetAccountByPrivateDomain for SQLite (#1242) --- management/server/sqlite_store.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/management/server/sqlite_store.go b/management/server/sqlite_store.go index c5356581a..ed473e143 100644 --- a/management/server/sqlite_store.go +++ b/management/server/sqlite_store.go @@ -245,7 +245,8 @@ func (s *SqliteStore) DeleteTokenID2UserIDIndex(tokenID string) error { func (s *SqliteStore) GetAccountByPrivateDomain(domain string) (*Account, error) { var account Account - result := s.db.First(&account, "domain = ?", strings.ToLower(domain)) + result := s.db.First(&account, "domain = ? and is_domain_primary_account = ? and domain_category = ?", + strings.ToLower(domain), true, PrivateCategory) if result.Error != nil { return nil, status.Errorf(status.NotFound, "account not found: provided domain is not registered or is not private") }