Skip to content

Commit

Permalink
use peers accountID
Browse files Browse the repository at this point in the history
  • Loading branch information
pascal-fischer committed Dec 19, 2024
1 parent 565a77c commit 8e54776
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions management/server/grpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8e54776

Please sign in to comment.