diff --git a/daemon/rpc_logout.go b/daemon/rpc_logout.go index 954bd795..03b7773c 100644 --- a/daemon/rpc_logout.go +++ b/daemon/rpc_logout.go @@ -95,7 +95,7 @@ func (r *RPC) Logout(ctx context.Context, in *pb.LogoutRequest) (payload *pb.Pay } } - if !r.ncClient.Revoke(internal.IsDevEnv(string(r.environment))) { + if !r.ncClient.Revoke() { log.Println(internal.WarningPrefix, "error revoking NC token") } diff --git a/daemon/rpc_logout_test.go b/daemon/rpc_logout_test.go index 62683c25..c791b8c9 100644 --- a/daemon/rpc_logout_test.go +++ b/daemon/rpc_logout_test.go @@ -23,8 +23,8 @@ type mockNC struct { nc.NotificationClient } -func (mockNC) Stop() error { return nil } -func (mockNC) Revoke(bool) bool { return true } +func (mockNC) Stop() error { return nil } +func (mockNC) Revoke() bool { return true } type mockApi struct { core.CombinedAPI diff --git a/daemon/rpc_set_defaults.go b/daemon/rpc_set_defaults.go index 35c558b3..d4375901 100644 --- a/daemon/rpc_set_defaults.go +++ b/daemon/rpc_set_defaults.go @@ -31,7 +31,7 @@ func (r *RPC) SetDefaults(ctx context.Context, in *pb.Empty) (*pb.Payload, error } if internal.IsDevEnv(string(r.environment)) { - if !r.ncClient.Revoke(true) { + if !r.ncClient.Revoke() { log.Println(internal.WarningPrefix, "error revoking token") } } diff --git a/nc/nc.go b/nc/nc.go index 0a586168..bafc6022 100644 --- a/nc/nc.go +++ b/nc/nc.go @@ -103,7 +103,7 @@ type AcknowledgementPayload struct { type NotificationClient interface { Start() error Stop() error - Revoke(bool) bool + Revoke() bool } type ClientBuilder interface { @@ -486,7 +486,7 @@ func (c *Client) Stop() error { } // Revoke revokes the NC communication token -func (c *Client) Revoke(purgeSession bool) bool { +func (c *Client) Revoke() bool { c.startMu.Lock() defer c.startMu.Unlock() @@ -495,8 +495,7 @@ func (c *Client) Revoke(purgeSession bool) bool { return false } - log.Println(logPrefix, "revoking token, purgeSession:", purgeSession) - ok, err := c.credsFetcher.RevokeCredentials(purgeSession) + ok, err := c.credsFetcher.RevokeCredentials(true) if ok { log.Println(logPrefix, "token revoked successfully") return true