From 8e547768d492caaff94d3e873a4faf0d9b46d1e3 Mon Sep 17 00:00:00 2001 From: Pascal Fischer Date: Thu, 19 Dec 2024 14:08:54 +0100 Subject: [PATCH] use peers accountID --- management/server/grpcserver.go | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/management/server/grpcserver.go b/management/server/grpcserver.go index f8a9676590e..e198738d038 100644 --- a/management/server/grpcserver.go +++ b/management/server/grpcserver.go @@ -485,21 +485,20 @@ func (s *GRPCServer) Login(ctx context.Context, req *proto.EncryptedMessage) (*p } } - // settings, err := s.settingsManager.GetSettings(ctx, accountID, userID) - // if err != nil { - // log.WithContext(ctx).Errorf("failed to get settings for account %s and user %s: %v", accountID, userID, err) - // } + settings, err := s.settingsManager.GetSettings(ctx, peer.AccountID, userID) + if err != nil { + log.WithContext(ctx).Errorf("failed to get settings for account %s and user %s: %v", peer.AccountID, userID, err) + } - // routingPeerDNSResolutionEnabled := false - // if settings != nil { - // routingPeerDNSResolutionEnabled = settings.RoutingPeerDNSResolutionEnabled - // } - // log.WithContext(ctx).Debugf("dns resolution on routing peer is enabled: %v", routingPeerDNSResolutionEnabled) + routingPeerDNSResolutionEnabled := false + if settings != nil { + routingPeerDNSResolutionEnabled = settings.RoutingPeerDNSResolutionEnabled + } // if peer has reached this point then it has logged in loginResp := &proto.LoginResponse{ WiretrusteeConfig: toWiretrusteeConfig(s.config, nil, relayToken), - PeerConfig: toPeerConfig(peer, netMap.Network, s.accountManager.GetDNSDomain(), false), + PeerConfig: toPeerConfig(peer, netMap.Network, s.accountManager.GetDNSDomain(), routingPeerDNSResolutionEnabled), Checks: toProtocolChecks(ctx, postureChecks), } encryptedResp, err := encryption.EncryptMessage(peerKey, s.wgKey, loginResp)