mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-25 04:01:29 +02:00
Fix GetAccountByPrivateDomain for SQLite (#1242)
This commit is contained in:
parent
90c2093018
commit
7a5c6b24ae
@ -245,7 +245,8 @@ func (s *SqliteStore) DeleteTokenID2UserIDIndex(tokenID string) error {
|
|||||||
func (s *SqliteStore) GetAccountByPrivateDomain(domain string) (*Account, error) {
|
func (s *SqliteStore) GetAccountByPrivateDomain(domain string) (*Account, error) {
|
||||||
var account Account
|
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 {
|
if result.Error != nil {
|
||||||
return nil, status.Errorf(status.NotFound, "account not found: provided domain is not registered or is not private")
|
return nil, status.Errorf(status.NotFound, "account not found: provided domain is not registered or is not private")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user