From b320b13b5d019c26928d2f00d8cba0febacb104b Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Fri, 13 Jan 2023 13:56:26 +0100 Subject: Client + Exports: Separate cleanup from disconnect --- client/fsm.go | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'client/fsm.go') diff --git a/client/fsm.go b/client/fsm.go index 88f2cf9..f9c7976 100644 --- a/client/fsm.go +++ b/client/fsm.go @@ -2,7 +2,6 @@ package client import ( "github.com/eduvpn/eduvpn-common/internal/fsm" - "github.com/eduvpn/eduvpn-common/internal/oauth" "github.com/eduvpn/eduvpn-common/internal/server" "github.com/go-errors/errors" ) @@ -295,7 +294,7 @@ func (c *Client) SetDisconnecting() error { // This indicates that the VPN is currently disconnected from the server. // This also sends the /disconnect API call to the server. // Returns an error if this state transition is not possible. -func (c *Client) SetDisconnected(cleanup bool, ct oauth.Token) error { +func (c *Client) SetDisconnected() error { if c.InFSMState(StateDisconnected) { // already disconnected, show no error c.Logger.Warningf("Already disconnected") @@ -312,18 +311,6 @@ func (c *Client) SetDisconnected(cleanup bool, ct oauth.Token) error { return err } - if cleanup { - // If we need to relogin, update tokens - if server.NeedsRelogin(srv) { - server.UpdateTokens(srv, ct) - } - // Do the /disconnect API call and go to disconnected after... - err := server.Disconnect(srv) - if err != nil { - c.Logger.Warningf("Error disconnecting %v", err) - } - } - c.FSM.GoTransitionWithData(StateDisconnected, srv) return nil -- cgit v1.2.3