From e2e3e9a82f0f9421ea994bb517651bb0ac2251f5 Mon Sep 17 00:00:00 2001 From: Jonathan Hurter Date: Fri, 2 Aug 2019 17:18:06 +0200 Subject: [PATCH] Do not disconnect user on 401 --- CHANGELOG.md | 1 + cmd/error.go | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55921537a..dedff9855 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### To be Released * Add support for stack aliases [#461](https://github.com/Scalingo/cli/pull/461) +* Bugfix: Do not disconnect user if the API returns 401 [#462](https://github.com/Scalingo/cli/issues/462) ### 1.15.1 diff --git a/cmd/error.go b/cmd/error.go index 5a521da0d..80ec91380 100644 --- a/cmd/error.go +++ b/cmd/error.go @@ -11,7 +11,6 @@ import ( "github.com/Scalingo/cli/config" "github.com/Scalingo/cli/io" - "github.com/Scalingo/cli/session" "github.com/Scalingo/go-scalingo" "github.com/Scalingo/go-scalingo/debug" httpclient "github.com/Scalingo/go-scalingo/http" @@ -69,7 +68,6 @@ func errorQuit(err error) { if httpclient.IsRequestFailedError(rootError) && rootError.(*httpclient.RequestFailedError).Code == 401 { if currentUser != nil { - session.DestroyToken() io.Errorf("You are currently logged in as %s.\n", currentUser.Username) io.Errorf("Are you sure %s is a collaborator of this app?\n", currentUser.Username) } else {