summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-03-18 13:58:08 +0100
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-04-05 12:26:16 +0200
commit2d5c7dad599b3f8b70ab07382973c51d1de2193d (patch)
tree3ca48a1104f958f896813a4d70093cdc27429133 /cli
parent343836597df3efd6f31a68e29ff82b6ec4979f69 (diff)
Refactor: Structures changed and added Token refresh function
Diffstat (limited to 'cli')
-rw-r--r--cli/main.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/cli/main.go b/cli/main.go
index 42c4b67..ccec3f4 100644
--- a/cli/main.go
+++ b/cli/main.go
@@ -34,17 +34,23 @@ func main() {
state := eduvpn.GetVPNState()
- eduvpn.Register(state, "org.eduvpn.app.linux", urlString, logState)
- authURL, err := eduvpn.InitializeOAuth(state)
+ eduvpn.Register(state, "org.eduvpn.app.linux", logState)
+ state.Server = &eduvpn.Server{}
+ serverInitializeErr := state.Server.Initialize(urlString)
+ if serverInitializeErr != nil {
+ log.Fatal(serverInitializeErr)
+ }
+
+ authURL, err := state.InitializeOAuth()
if err != nil {
log.Fatal(err)
}
openBrowser(authURL)
- oauthErr := eduvpn.FinishOAuth(state)
+ oauthErr := state.FinishOAuth()
if oauthErr != nil {
log.Fatal(oauthErr)
}
- infoString, infoErr := eduvpn.APIAuthenticatedInfo(state)
+ infoString, infoErr := state.APIAuthenticatedInfo()
if infoErr != nil {
log.Fatal(infoErr)
}