From 948d986fda345ff41da699adf2dbf26144269145 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Thu, 14 Mar 2024 17:19:25 +0100 Subject: Client + Server: Cache secure internet profile choice per location --- client/client.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'client') diff --git a/client/client.go b/client/client.go index 73f94d3..cfb95eb 100644 --- a/client/client.go +++ b/client/client.go @@ -517,6 +517,16 @@ func (c *Client) SetSecureLocation(orgID string, countryCode string) error { return i18nerr.Wrapf(err, "Failed to get the secure internet server with id: '%s' for setting a location", orgID) } srv.CountryCode = countryCode + + // no cached location profiles + if srv.LocationProfiles == nil { + return nil + } + + // restore profile from the location + if v, ok := srv.LocationProfiles[srv.CountryCode]; ok { + srv.Profiles.Current = v + } return nil } -- cgit v1.2.3