summaryrefslogtreecommitdiff
path: root/internal/fsm
diff options
context:
space:
mode:
Diffstat (limited to 'internal/fsm')
-rw-r--r--internal/fsm/fsm.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/fsm/fsm.go b/internal/fsm/fsm.go
index 2042977..1ba8133 100644
--- a/internal/fsm/fsm.go
+++ b/internal/fsm/fsm.go
@@ -36,6 +36,9 @@ const (
// No Server means the user has not chosen a server yet
NO_SERVER
+ // The user selected a Secure Internet server but needs to choose a location
+ ASK_LOCATION
+
// The user is currently selecting a server in the UI
SEARCH_SERVER
@@ -67,6 +70,8 @@ func (s FSMStateID) String() string {
return "Deregistered"
case NO_SERVER:
return "No_Server"
+ case ASK_LOCATION:
+ return "Ask_Location"
case SEARCH_SERVER:
return "Search_Server"
case CHOSEN_SERVER:
@@ -113,7 +118,8 @@ type FSM struct {
func (fsm *FSM) Init(name string, callback func(string, string, string), logger *log.FileLogger, directory string, debug bool) {
fsm.States = FSMStates{
DEREGISTERED: {{NO_SERVER, "Client registers"}},
- NO_SERVER: {{CHOSEN_SERVER, "User chooses a server"}, {SEARCH_SERVER, "The user is trying to choose a Server in the UI"}},
+ NO_SERVER: {{CHOSEN_SERVER, "User chooses a server"}, {SEARCH_SERVER, "The user is trying to choose a Server in the UI"}, {ASK_LOCATION, "User chooses a Secure Internet server but no location is configured"}},
+ ASK_LOCATION: {{CHOSEN_SERVER, "Location chosen"}, {NO_SERVER, "Cancel or Error"}},
SEARCH_SERVER: {{CHOSEN_SERVER, "User clicks a server in the UI"}, {NO_SERVER, "Cancel or Error"}},
CHOSEN_SERVER: {{AUTHORIZED, "Found tokens in config"}, {OAUTH_STARTED, "No tokens found in config"}},
OAUTH_STARTED: {{AUTHORIZED, "User authorizes with browser"}, {NO_SERVER, "Cancel or Error"}},