summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2023-04-18 10:11:24 +0200
committerJeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com>2023-04-18 14:05:19 +0200
commit445838445891e349cee4d85762cc1423f8249b24 (patch)
treebc16e33a34f879bc2fd1ca3061f33279bf951baa
parentf18d4e4d201ebda35f7c5b8c6f6c826da0d60854 (diff)
Client + Server: Set default secure internet location
-rw-r--r--client/server.go8
-rw-r--r--internal/server/secureinternet.go5
2 files changed, 5 insertions, 8 deletions
diff --git a/client/server.go b/client/server.go
index 80620dd..9d3b3b4 100644
--- a/client/server.go
+++ b/client/server.go
@@ -303,14 +303,6 @@ func (c *Client) AddSecureInternetHomeServer(orgID string) (srv server.Server, e
return nil, err
}
- // TODO(jwijenbergh): Does this call transfers execution flow to UI?
- if err = c.askSecureLocation(); err != nil {
- // Removing is the best effort
- // This already goes back to the main screen
- _ = c.RemoveSecureInternet()
- return nil, err
- }
-
// Set the server as the current so OAuth can be cancelled
if err = c.Servers.SetSecureInternet(srv); err != nil {
c.goBackInternal()
diff --git a/internal/server/secureinternet.go b/internal/server/secureinternet.go
index bd2d66a..9b1d394 100644
--- a/internal/server/secureinternet.go
+++ b/internal/server/secureinternet.go
@@ -127,6 +127,11 @@ func (s *SecureInternetHomeServer) init(
return err
}
+ // Set the current location to the home location if there is none
+ if s.CurrentLocation == "" {
+ s.CurrentLocation = homeLoc.CountryCode
+ }
+
// Make sure oauth contains our endpoints
s.Auth.Init(b.URL, b.Endpoints.API.V3.Authorization, b.Endpoints.API.V3.Token)
return nil