Skip to content

Commit

Permalink
Fix NC token revoke during logout
Browse files Browse the repository at this point in the history
  • Loading branch information
bartoszWojciechO authored Oct 23, 2024
1 parent baa387f commit a50d3f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions daemon/rpc_logout.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ func (r *RPC) Logout(ctx context.Context, in *pb.LogoutRequest) (payload *pb.Pay
return &pb.Payload{Type: internal.CodeFailure}, nil
}

if !r.ncClient.Revoke(internal.IsDevEnv(string(r.environment))) {
log.Println(internal.WarningPrefix, "error revoking NC token")
}

if !in.GetPersistToken() {
if err := r.credentialsAPI.DeleteToken(tokenData.Token); err != nil {
log.Println(internal.ErrorPrefix, "deleting token: ", err)
Expand Down Expand Up @@ -95,10 +99,6 @@ func (r *RPC) Logout(ctx context.Context, in *pb.LogoutRequest) (payload *pb.Pay
}
}

if !r.ncClient.Revoke(internal.IsDevEnv(string(r.environment))) {
log.Println(internal.WarningPrefix, "error revoking NC token")
}

if err := r.cm.SaveWith(func(c config.Config) config.Config {
delete(c.TokensData, c.AutoConnectData.ID)
c.AutoConnectData.ID = 0
Expand Down

0 comments on commit a50d3f2

Please sign in to comment.