summaryrefslogtreecommitdiff
path: root/src/state.go
diff options
context:
space:
mode:
authorJeroen Wijenbergh <jeroenwijenbergh@protonmail.com>2022-03-28 23:29:43 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-03-28 23:29:43 +0200
commit6192f9ab54a805c1fabe6a2c5b8eca622b565082 (patch)
treef889404ebca573c8ecc886ea1858dc6822158f6e /src/state.go
parent785e34a4ebacee7dea16af6d16725647b7f6fd7d (diff)
OAuth: Token refresh changes and tests
Diffstat (limited to 'src/state.go')
-rw-r--r--src/state.go16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/state.go b/src/state.go
index fcc5930..12ad57a 100644
--- a/src/state.go
+++ b/src/state.go
@@ -39,21 +39,11 @@ func (state *VPNState) Connect(url string) (string, error) {
}
if !state.Server.IsAuthenticated() {
- authURL, authInitializeErr := state.InitializeOAuth()
+ loginErr := state.LoginOAuth()
- if authInitializeErr != nil {
- return "", authInitializeErr
+ if loginErr != nil {
+ return "", loginErr
}
-
- go state.StateCallback("Registered", "OAuthInitialized", authURL)
- oauthErr := state.FinishOAuth()
-
- if oauthErr != nil {
- return "", oauthErr
- }
-
- state.StateCallback("OAuthInitialized", "OAuthFinished", "finished oauth")
- state.WriteConfig()
}
return state.Server.GetConfig()